pub trait BufferHeader<T: ?Sized>:
Copy
+ Debug
+ Sized {
const EMPTY: Self;
// Required methods
fn is_empty(&self) -> bool;
fn layout(&self) -> Result<Layout, LayoutError>;
fn update_for_alloc(
&mut self,
ptr: NonNull<[u8]>,
exact: bool,
) -> NonNull<T>;
}
Expand description
A header type used by a buffer to determine its size.
Required Associated Constants§
Required Methods§
Sourcefn layout(&self) -> Result<Layout, LayoutError>
fn layout(&self) -> Result<Layout, LayoutError>
Calculate the layout for the associated value.
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.