Struct packed_ptr::PackedRef
source · pub struct PackedRef<'a, T, C: PtrCfg, D: Packable>(/* private fields */);Implementations§
source§impl<'a, T, C: PtrCfg, D: Packable> PackedRef<'a, T, C, D>
impl<'a, T, C: PtrCfg, D: Packable> PackedRef<'a, T, C, D>
sourcepub fn new(ptr: &'a T, data: D, cfg: C) -> Result<Self, PackedPtrError>
pub fn new(ptr: &'a T, data: D, cfg: C) -> Result<Self, PackedPtrError>
Creates a new PackedRef from a reference and some data.
Errors
PackedPtrError::DataOverflowif the data is too large to fit in the pointer.PackedPtrError::UnsafeConfigif the pointer is not compatible with the configuration.
pub fn data(self) -> D
pub fn get(self) -> (&'a T, D)
Trait Implementations§
impl<T, C: PtrCfg, D: Packable> Copy for PackedRef<'_, T, C, D>
Auto Trait Implementations§
impl<'a, T, C, D> RefUnwindSafe for PackedRef<'a, T, C, D>
impl<'a, T, C, D> !Send for PackedRef<'a, T, C, D>
impl<'a, T, C, D> !Sync for PackedRef<'a, T, C, D>
impl<'a, T, C, D> Unpin for PackedRef<'a, T, C, D>
impl<'a, T, C, D> UnwindSafe for PackedRef<'a, T, C, D>
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