Struct fidl_next::RawWireUnion

source ·
#[repr(C)]
pub struct RawWireUnion<'buf> { /* private fields */ }
Expand description

A raw FIDL union

Implementations§

source§

impl<'buf> RawWireUnion<'buf>

source

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

Encodes that a union is absent in a slot.

source

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

Encodes a value and ordinal in a slot.

source

pub fn encoded_ordinal(slot: Slot<'_, Self>) -> u64

Returns the ordinal of the encoded value.

source

pub fn decode_absent(slot: Slot<'_, Self>) -> Result<(), DecodeError>

Decodes an absent union from a slot.

source

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

Decodes an unknown value from a union.

The handles owned by the unknown value are discarded.

source

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

Decodes the typed value in a union.

source

pub fn null() -> Self

The null (absent) union.

source

pub fn is_some(&self) -> bool

Returns whether the union contains a value.

source

pub fn is_none(&self) -> bool

Returns whether the union is empty.

source

pub fn ordinal(&self) -> u64

Returns the ordinal of the union.

source

pub fn get(&self) -> &WireEnvelope<'buf>

Gets a reference to the envelope underlying the union.

source

pub fn get_mut(&mut self) -> &mut WireEnvelope<'buf>

Gets a mutable reference to the envelope underlying the union.

Auto Trait Implementations§

§

impl<'buf> Freeze for RawWireUnion<'buf>

§

impl<'buf> RefUnwindSafe for RawWireUnion<'buf>

§

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

§

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

§

impl<'buf> Unpin for RawWireUnion<'buf>

§

impl<'buf> !UnwindSafe for RawWireUnion<'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.