[][src]Struct swim_mem::block::Layout

pub struct Layout { /* fields omitted */ }

Size and alignment constraints for a memory block.

Methods

impl Layout[src]

pub const fn empty() -> Layout[src]

Returns a zero-sized Layout with byte alignment.

pub const unsafe fn from_size_align_unchecked(
    size: usize,
    align: usize
) -> Layout
[src]

Returns a Layout with the given size and power-of-two alignment.

pub fn from_size_align(size: usize, align: usize) -> Result<Layout, LayoutError>[src]

Returns a Layout with the given size and power-of-two alignment, or None for invalid constraints.

pub fn for_type<T>() -> Layout[src]

Returns the Layout of the parameterized type.

pub fn for_value<T: ?Sized>(value: &T) -> Layout[src]

Returns the Layout of the given value.

pub fn for_array<T>(len: usize) -> Result<Layout, LayoutError>[src]

Returns the Layout of an array of len values of the parameterized type.

pub unsafe fn for_array_unchecked<T>(len: usize) -> Layout[src]

pub const fn size(&self) -> usize[src]

Returns the required size in bytes of a valid memory block.

pub fn align(&self) -> usize[src]

Returns the required power-of-two base address alignment for a valid memory block.

pub fn aligned_to(&self, align: usize) -> Layout[src]

Returns this layout with at least align byte alignment.

pub fn aligned_to_type<T>(&self) -> Layout[src]

Returns this layout with at least the alignment of the parameterized type.

pub fn aligned_to_value<T: ?Sized>(&self, value: &T) -> Layout[src]

Returns this layout with at least the alignment of the given value.

pub fn padded_to(&self, align: usize) -> Layout[src]

Returns this layout with its size rounded up to the given alignment.

pub fn padded_to_type<T>(&self) -> Layout[src]

Returns this layout with its size rouneded up to the alignment of a subsequent field of the given type.

pub fn padded_to_value<T: ?Sized>(&self, value: &T) -> Layout[src]

Returns this layout with its size rounded up to the the alignment of alignment of the given field.

pub fn extended(&self, that: Layout) -> Result<(Layout, usize), LayoutError>[src]

Returns the Layout of a struct with this layout as its first member, and that layout as its second member.

pub fn extended_by_type<T>(&self) -> Result<(Layout, usize), LayoutError>[src]

pub fn extended_by_value<T: ?Sized>(
    &self,
    value: &T
) -> Result<(Layout, usize), LayoutError>
[src]

pub fn extended_by_array<T>(
    &self,
    len: usize
) -> Result<(Layout, usize), LayoutError>
[src]

pub unsafe fn extended_unchecked(&self, that: Layout) -> (Layout, usize)[src]

Returns the Layout of a struct with this layout as its first member, and that layout as its second member, without checking for size overflow.

pub unsafe fn extended_by_type_unchecked<T>(&self) -> (Layout, usize)[src]

pub unsafe fn extended_by_value_unchecked<T: ?Sized>(
    &self,
    value: &T
) -> (Layout, usize)
[src]

pub unsafe fn extended_by_array_unchecked<T>(
    &self,
    len: usize
) -> (Layout, usize)
[src]

pub fn repeated(&self, len: usize) -> Result<(Layout, usize), LayoutError>[src]

Returns the Layout of an array with len elements of this layout.

pub unsafe fn repeated_unchecked(&self, len: usize) -> (Layout, usize)[src]

Returns the Layout of an array with len elements of this layout, without checking for size overflow.

Trait Implementations

impl PartialEq<Layout> for Layout[src]

impl Eq for Layout[src]

impl Debug for Layout[src]

impl Copy for Layout[src]

impl Clone for Layout[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Layout

impl Sync for Layout

Blanket Implementations

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

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