Union fidl_next::WireEnvelope

source ·
#[repr(C, align(8))]
pub union WireEnvelope<'buf> {
    /* private fields */
}
Expand description

A FIDL envelope

Implementations§

source§

impl<'buf> WireEnvelope<'buf>

source

pub fn encode_zero(slot: Slot<'_, Self>)

Encodes a zero envelope into a slot.

source

pub fn encode_value<E: Encoder + ?Sized, T: Encode<E>>( value: &mut T, encoder: &mut E, slot: Slot<'_, Self>, ) -> Result<(), EncodeError>

Encodes a value into an envelope with an encoder.

source

pub fn zero() -> Self

Returns the zero envelope.

source

pub fn is_encoded_zero(slot: Slot<'_, Self>) -> bool

Returns whether a envelope slot is encoded as zero.

source

pub fn is_zero(&self) -> bool

Returns whether an envelope is zero.

source

pub fn decode_unknown<D: Decoder<'buf> + ?Sized>( slot: Slot<'_, Self>, decoder: &mut D, ) -> Result<(), DecodeError>

Decodes and discards an unknown value in an envelope.

source

pub fn decode_as<D: Decoder<'buf> + ?Sized, T: Decode<D>>( slot: Slot<'_, Self>, decoder: &mut D, ) -> Result<(), DecodeError>

Decodes a value of a known type from an envelope.

source

pub unsafe fn deref_unchecked<T>(&self) -> &T

Returns a reference to the contained T.

§Safety

The envelope must have been successfully decoded as a T.

source

pub unsafe fn deref_mut_unchecked<T>(&mut self) -> &mut T

Returns a mutable reference to the contained T.

§Safety

The envelope must have been successfully decoded as a T.

source

pub unsafe fn take_unchecked<T>(&mut self) -> T

Takes the contained T, leaving an empty envelope.

§Safety

The envelope must have been successfully decoded as a T.

Auto Trait Implementations§

§

impl<'buf> Freeze for WireEnvelope<'buf>

§

impl<'buf> RefUnwindSafe for WireEnvelope<'buf>

§

impl<'buf> !Send for WireEnvelope<'buf>

§

impl<'buf> !Sync for WireEnvelope<'buf>

§

impl<'buf> Unpin for WireEnvelope<'buf>

§

impl<'buf> !UnwindSafe for WireEnvelope<'buf>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.