Struct memsecurity::ZeroizeBytes
source · pub struct ZeroizeBytes(/* private fields */);
Expand description
Similar to ZeroizeBytesArray
but this does not have a fixed size length.
This is more similar to using a Vec
than an array
Structure
use bytes::BytesMut;
pub struct ZeroizeBytes(BytesMut);
Implementations§
source§impl ZeroizeBytes
impl ZeroizeBytes
sourcepub fn new_with_data(value: &[u8]) -> Self
pub fn new_with_data(value: &[u8]) -> Self
Initialize the array and set the internal value of the array to the value specified by method argument
sourcepub fn set_bytes_mut(&mut self, value: BytesMut) -> &mut Self
pub fn set_bytes_mut(&mut self, value: BytesMut) -> &mut Self
Set the internal value of the array to the value specified by method argument value which is a BytesMut
sourcepub fn new_with_capacity(capacity: usize) -> Self
pub fn new_with_capacity(capacity: usize) -> Self
Initializes the array with a specified capacity
sourcepub fn expose_borrowed(&self) -> &BytesMut
pub fn expose_borrowed(&self) -> &BytesMut
Expose the internal value
Trait Implementations§
source§impl AsRef<[u8]> for ZeroizeBytes
impl AsRef<[u8]> for ZeroizeBytes
source§impl BorshDeserialize for ZeroizeBytes
impl BorshDeserialize for ZeroizeBytes
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for ZeroizeBytes
impl BorshSerialize for ZeroizeBytes
source§impl Debug for ZeroizeBytes
impl Debug for ZeroizeBytes
source§impl Default for ZeroizeBytes
impl Default for ZeroizeBytes
source§impl Drop for ZeroizeBytes
impl Drop for ZeroizeBytes
source§impl PartialEq for ZeroizeBytes
impl PartialEq for ZeroizeBytes
source§impl Zeroize for ZeroizeBytes
impl Zeroize for ZeroizeBytes
impl Eq for ZeroizeBytes
impl ZeroizeOnDrop for ZeroizeBytes
Auto Trait Implementations§
impl RefUnwindSafe for ZeroizeBytes
impl Send for ZeroizeBytes
impl Sync for ZeroizeBytes
impl Unpin for ZeroizeBytes
impl UnwindSafe for ZeroizeBytes
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more