Struct Decoded
pub struct Decoded<T, D>where
T: ?Sized,{ /* private fields */ }
Expand description
A decoded value and the decoder which contains it.
Implementations§
§impl<T, D> Decoded<T, D>where
T: ?Sized,
impl<T, D> Decoded<T, D>where
T: ?Sized,
pub unsafe fn new_unchecked(ptr: *mut T, decoder: D) -> Decoded<T, D>
pub unsafe fn new_unchecked(ptr: *mut T, decoder: D) -> Decoded<T, D>
Creates an owned value contained within a decoder.
Decoded
drops ptr
, but does not free the backing memory. decoder
should free the
memory backing ptr
when dropped.
§Safety
ptr
must be non-null, properly-aligned, and valid for reads and writes.ptr
must be valid for dropping.ptr
must remain valid untildecoder
is dropped.
pub fn into_raw_parts(self) -> (*mut T, D)
pub fn into_raw_parts(self) -> (*mut T, D)
Returns the raw pointer and decoder used to create this Decoded
.
Trait Implementations§
impl<T, D> Send for Decoded<T, D>
impl<T, D> Sync for Decoded<T, D>
Auto Trait Implementations§
impl<T, D> Freeze for Decoded<T, D>
impl<T, D> RefUnwindSafe for Decoded<T, D>
impl<T, D> Unpin for Decoded<T, D>
impl<T, D> UnwindSafe for Decoded<T, 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