pub trait MutBytes: Bytes {
// Required methods
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ;
fn copy_from_slice(&mut self, other: &[u8]);
}Expand description
Arbitrary-length array of mutable bytes.
Required Methods§
Sourcefn as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Returns a mutable slice to the underlying bytes.
Sourcefn copy_from_slice(&mut self, other: &[u8])
fn copy_from_slice(&mut self, other: &[u8])
Copies into the underlying slice from other. Panics if lengths do not
match.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl MutBytes for Vec<u8>
impl MutBytes for Vec<u8>
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn copy_from_slice(&mut self, other: &[u8])
Source§impl MutBytes for [u8]
impl MutBytes for [u8]
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn copy_from_slice(&mut self, other: &[u8])
Source§impl<const LENGTH: usize> MutBytes for [u8; LENGTH]
impl<const LENGTH: usize> MutBytes for [u8; LENGTH]
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn copy_from_slice(&mut self, other: &[u8])
Implementors§
impl MutBytes for HeapBytes
Available on crate feature
protected only.impl<A: Zeroize + MutBytes, LM: LockMode> MutBytes for Protected<A, ReadWrite, LM>
Available on crate feature
protected only.impl<InnerKey: ByteArray<CRYPTO_BOX_BEFORENMBYTES> + Zeroize + MutBytes> MutBytes for PrecalcSecretKey<InnerKey>
impl<const LENGTH: usize> MutBytes for HeapByteArray<LENGTH>
Available on crate feature
protected only.