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
ptrmust be non-null, properly-aligned, and valid for reads and writes.ptrmust be valid for dropping.ptrmust remain valid untildecoderis 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.
Sourcepub fn take(self) -> T::Natural
 
pub fn take(self) -> T::Natural
Takes the value out of this Decoded and calls FromWire::from_wire on the taken value to
convert it to the default natural type.
This consumes the 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