Skip to main content

MutBytes

Trait MutBytes 

Source
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§

Source

fn as_mut_slice(&mut self) -> &mut [u8]

Returns a mutable slice to the underlying bytes.

Source

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>

Source§

fn as_mut_slice(&mut self) -> &mut [u8]

Source§

fn copy_from_slice(&mut self, other: &[u8])

Source§

impl MutBytes for [u8]

Source§

fn as_mut_slice(&mut self) -> &mut [u8]

Source§

fn copy_from_slice(&mut self, other: &[u8])

Source§

impl<const LENGTH: usize> MutBytes for [u8; LENGTH]

Source§

fn as_mut_slice(&mut self) -> &mut [u8]

Source§

fn copy_from_slice(&mut self, other: &[u8])

Implementors§

Source§

impl MutBytes for HeapBytes

Available on crate feature protected only.
Source§

impl<A: Zeroize + MutBytes, LM: LockMode> MutBytes for Protected<A, ReadWrite, LM>

Available on crate feature protected only.
Source§

impl<InnerKey: ByteArray<CRYPTO_BOX_BEFORENMBYTES> + Zeroize + MutBytes> MutBytes for PrecalcSecretKey<InnerKey>

Source§

impl<const LENGTH: usize> MutBytes for HeapByteArray<LENGTH>

Available on crate feature protected only.
Source§

impl<const LENGTH: usize> MutBytes for StackByteArray<LENGTH>