BufferMut

Trait BufferMut 

Source
pub trait BufferMut: Buffer
where Self: Sized,
{ // Required methods fn zero(&mut self); fn try_clone(&self) -> Result<Self, HardError>; }
Expand description

Trait implemented by any buffer type with mutable contents.

Required Methods§

Source

fn zero(&mut self)

Overwrite the contents of the buffer with zeros, in such a way that will not be optimised away by the compiler.

Buffers are automatically zeroed on drop, you should not need to call this method yourself unless you want to set a buffer to zero for initialisation purposes.

Source

fn try_clone(&self) -> Result<Self, HardError>

Attempt to clone this buffer.

This will allocate a new region of memory, and copy the contents of this buffer into it.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§