pub struct NonZeroLayout(/* private fields */);
Expand description
A non-empty layout which can be allocated.
Implementations§
Source§impl NonZeroLayout
impl NonZeroLayout
Sourcepub fn new<T>() -> Option<Self>
pub fn new<T>() -> Option<Self>
Create the layout for a type.
This succeeds exactly if the type is not a zero-sized type. Otherwise this constructor
returns None
.
Sourcepub fn from_layout(layout: Layout) -> Option<Self>
pub fn from_layout(layout: Layout) -> Option<Self>
Creates a non-empty layout if the given layout is not empty.
Sourcepub fn size(&self) -> NonZeroUsize
pub fn size(&self) -> NonZeroUsize
Return the size of the layout.
Trait Implementations§
Source§impl Clone for NonZeroLayout
impl Clone for NonZeroLayout
Source§fn clone(&self) -> NonZeroLayout
fn clone(&self) -> NonZeroLayout
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NonZeroLayout
impl Debug for NonZeroLayout
Source§impl From<NonZeroLayout> for Layout
impl From<NonZeroLayout> for Layout
Source§fn from(layout: NonZeroLayout) -> Layout
fn from(layout: NonZeroLayout) -> Layout
Converts to this type from the input type.
Source§impl PartialEq for NonZeroLayout
impl PartialEq for NonZeroLayout
Source§impl TryFrom<Layout> for NonZeroLayout
impl TryFrom<Layout> for NonZeroLayout
Source§impl TryFrom<Layout> for NonZeroLayout
impl TryFrom<Layout> for NonZeroLayout
impl Copy for NonZeroLayout
impl StructuralPartialEq for NonZeroLayout
Auto Trait Implementations§
impl Freeze for NonZeroLayout
impl RefUnwindSafe for NonZeroLayout
impl Send for NonZeroLayout
impl Sync for NonZeroLayout
impl Unpin for NonZeroLayout
impl UnwindSafe for NonZeroLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)