pub struct AnyByLayout(/* private fields */);Implementations§
Source§impl AnyByLayout
impl AnyByLayout
pub const NONE: &mut Self
Sourcepub unsafe fn from_raw_parts<'a>(data: *mut u8, size: usize) -> &'a mut Self
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.
pub const fn from_mutable<T>(argument: &mut T) -> &mut Self
pub fn from<T>(argument: &T) -> &Self
pub fn cast_mutable<T>(&mut self) -> Option<&mut T>
pub fn cast<T>(&self) -> Option<&T>
pub fn get_size(&self) -> usize
pub fn get_alignment(&self) -> usize
pub fn as_mutable_bytes(&mut self) -> &mut [u8] ⓘ
Trait Implementations§
Source§impl Debug for AnyByLayout
impl Debug for AnyByLayout
Source§impl<'a, T> From<&'a T> for &'a AnyByLayout
impl<'a, T> From<&'a T> for &'a AnyByLayout
Source§impl<'a, T> From<&'a mut T> for &'a mut AnyByLayout
impl<'a, T> From<&'a mut T> for &'a mut AnyByLayout
Source§impl PartialEq for AnyByLayout
impl PartialEq for AnyByLayout
Source§fn eq(&self, other: &AnyByLayout) -> bool
fn eq(&self, other: &AnyByLayout) -> bool
Tests for
self and other values to be equal, and is used by ==.