pub struct Decoded<T: ?Sized, D> { /* private fields */ }
Expand description
A decoded value and the decoder which contains it.
Implementations§
Source§impl<T: ?Sized, D> Decoded<T, D>
impl<T: ?Sized, D> Decoded<T, D>
Sourcepub unsafe fn new_unchecked(ptr: *mut T, decoder: D) -> Self
pub unsafe fn new_unchecked(ptr: *mut T, decoder: D) -> Self
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.
Sourcepub 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: Send + ?Sized, D: Send> Send for Decoded<T, D>
impl<T: Sync + ?Sized, D: Sync> 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