#[repr(C)]pub struct Repr {
pub base: BaseRepr,
pub packed: bool,
}Expand description
Describes base representation of the type
Is the structure packed, is it laid out like a C struct, is it a transparent wrapper?
Fields§
§base: BaseReprDescribes base layout representation of the type
packed: boolAre the values tightly packed?
Note, that if struct is packed, the underlying values may not be aligned, and it is
undefined behavior to interact with unaligned values - first copy the value to aligned
buffer, before interacting with it (but first, make sure it is Copy!)
Implementations§
Source§impl Repr
impl Repr
Sourcepub const TRANSPARENT: Self
pub const TRANSPARENT: Self
Transparent representation
Sourcepub const fn default() -> Self
pub const fn default() -> Self
Create default representation for a user type
This will be Rust representation with no packing
Sourcepub const fn transparent() -> Self
pub const fn transparent() -> Self
Builds transparent representation
Trait Implementations§
impl Copy for Repr
impl Eq for Repr
impl StructuralPartialEq for Repr
Auto Trait Implementations§
impl Freeze for Repr
impl RefUnwindSafe for Repr
impl Send for Repr
impl Sync for Repr
impl Unpin for Repr
impl UnwindSafe for Repr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more