[][src]Struct alloc_traits::NonZeroLayout

pub struct 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]

impl Copy for NonZeroLayout[src]

impl Debug for NonZeroLayout[src]

impl From<NonZeroLayout> for Layout[src]

impl PartialEq<NonZeroLayout> for NonZeroLayout[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.

impl TryFrom<Layout> for NonZeroLayout[src]

type Error = EmptyLayoutError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.