pub unsafe trait Buffer: Sized {
// Required methods
fn as_bytes(&self) -> &[u8] ⓘ;
fn into_bytes(self) -> Vec<u8> ⓘ;
}Expand description
Trusted byte buffer type.
§Safety
Any interior mutability in the buffer type must not affect the as_bytes
and into_bytes methods. In other words, as long as self is borrowed
immutably those functions must always return the same result.
Required Methods§
Sourcefn into_bytes(self) -> Vec<u8> ⓘ
fn into_bytes(self) -> Vec<u8> ⓘ
Turns this buffer into a byte array.
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.