Memory
tyrus:memory provides explicit lifecycle operations for values that contain sensitive data. The initial API is zeroize, which consumes an exclusively owned dynamic string or u8[], overwrites its allocation with zeroes using non-elidable writes, and releases it.
API
- drop: release an owned string, array, collection, or native handle before the end of its scope.
- swap: exchange two distinct mutable bindings of the same
Copytype orstring. - replace: store a new
Copyvalue or move astringfrom its source binding, then return the previous value. - sizeOf: the compile-time size in bytes of a primitive type.
- alignOf: the compile-time alignment in bytes of a primitive type.
- zeroize: erase and release an owned
stringoru8[]. - MemoryError: the error returned when a value is static, borrowed, shared, or invalid for secure erasure.
