Skip to main content

AnyByLayout

Struct AnyByLayout 

Source
pub struct AnyByLayout(/* private fields */);

Implementations§

Source§

impl AnyByLayout

Source

pub const NONE: &mut Self

Source

pub unsafe fn from_raw_parts<'a>(data: *mut u8, size: usize) -> &'a mut Self

Creates an AnyByLayout from raw parts.

§Safety

This function is unsafe because it creates a reference from a raw pointer. The caller must ensure that the pointer is valid for reads and writes for size bytes and properly aligned.

Source

pub const fn from_mutable<T>(argument: &mut T) -> &mut Self

Source

pub fn from<T>(argument: &T) -> &Self

Source

pub fn cast_mutable<T>(&mut self) -> Option<&mut T>

Source

pub fn cast<T>(&self) -> Option<&T>

Source

pub fn get_size(&self) -> usize

Source

pub fn get_alignment(&self) -> usize

Source

pub fn as_mutable_bytes(&mut self) -> &mut [u8] ⓘ

Trait Implementations§

Source§

impl Debug for AnyByLayout

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AnyByLayout

Source§

impl<'a, T> From<&'a T> for &'a AnyByLayout

Source§

fn from(argument: &'a T) -> Self

Converts to this type from the input type.
Source§

impl<'a, T> From<&'a mut T> for &'a mut AnyByLayout

Source§

fn from(argument: &'a mut T) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for AnyByLayout

Source§

fn eq(&self, other: &AnyByLayout) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AnyByLayout

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more