pub trait LayoutSpec {
// Required method
fn layout_with_capacity(items: usize) -> Result<Layout, LayoutError>;
}
Expand description
Types that specify a data structure’s storage layout requirements.
Required Methods§
Sourcefn layout_with_capacity(items: usize) -> Result<Layout, LayoutError>
fn layout_with_capacity(items: usize) -> Result<Layout, LayoutError>
Constructs a Layout
for a memory block capable of holding the
specified number of items.
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§
impl LayoutSpec for ObjectLayout
Available on crate feature
unstable
only.