Trait StableBufMut

Source
pub unsafe trait StableBufMut: StableBuf {
    // Required method
    fn stable_mut_ptr(&mut self) -> *mut u8;

    // Provided methods
    fn put_slice(&mut self, src: &[u8]) { ... }
    fn deref_mut(&mut self) -> &mut [u8]  { ... }
}
Expand description

A mutable buffer with a stable memory address.

§Safety

The implementor must guarantee that the pointer remains valid and unchanged while the buffer is being used.

Required Methods§

Source

fn stable_mut_ptr(&mut self) -> *mut u8

Returns a raw pointer to this buffer.

Provided Methods§

Source

fn put_slice(&mut self, src: &[u8])

Copies the given byte slice into this buffer. src must not overlap with this buffer. Panics if src exceeds this buffer’s length.

Source

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

Returns the buffer as a mutable slice.

Implementations on Foreign Types§

Source§

impl StableBufMut for Vec<u8>

Source§

impl StableBufMut for BytesMut

Implementors§