[−][src]Struct alloc_traits::NonZeroLayout
A non-empty layout which can be allocated.
Methods
impl NonZeroLayout[src]
pub fn new<T>() -> Option<Self>[src]
Create the layout for a type.
This succeeds exactly if the type is not a zero-sized type. Otherwise this constructor
returns None.
pub fn from_layout(layout: Layout) -> Option<Self>[src]
Creates a non-empty layout if the given layout is not empty.
pub fn size(&self) -> NonZeroUsize[src]
Return the size of the layout.
pub fn align(&self) -> usize[src]
Return the alignment of the layout.
Trait Implementations
impl Clone for NonZeroLayout[src]
fn clone(&self) -> NonZeroLayout[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Copy for NonZeroLayout[src]
impl Debug for NonZeroLayout[src]
impl From<NonZeroLayout> for Layout[src]
fn from(layout: NonZeroLayout) -> Layout[src]
impl PartialEq<NonZeroLayout> for NonZeroLayout[src]
fn eq(&self, other: &NonZeroLayout) -> bool[src]
fn ne(&self, other: &NonZeroLayout) -> bool[src]
impl StructuralPartialEq for NonZeroLayout[src]
impl TryFrom<Layout> for NonZeroLayout[src]
type Error = EmptyLayoutError
The type returned in the event of a conversion error.
fn try_from(layout: Layout) -> Result<Self, EmptyLayoutError>[src]
impl TryFrom<Layout> for NonZeroLayout[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,