fidl_next

Struct RawWireUnion

Source
#[repr(C)]
pub struct RawWireUnion { /* private fields */ }
Expand description

A raw FIDL union

Implementations§

Source§

impl RawWireUnion

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_static<D: InternalHandleDecoder + ?Sized>( slot: Slot<'_, Self>, decoder: &mut D, ) -> Result<(), DecodeError>

Decodes an unknown 'static value from a union.

The handles owned by the unknown value are discarded.

Source

pub fn decode_unknown<'buf, 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_static<D: InternalHandleDecoder + ?Sized, T: Decode<D>>( slot: Slot<'_, Self>, decoder: &mut D, ) -> Result<(), DecodeError>

Decodes the typed 'static value in a union.

Source

pub fn decode_as<'buf, 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

Gets a reference to the envelope underlying the union.

Source

pub fn get_mut(&mut self) -> &mut WireEnvelope

Gets a mutable reference to the envelope underlying the union.

Source

pub unsafe fn clone_unchecked<T: Clone>(&self) -> Self

Clones the union, assuming that it contains an inline T.

§Safety

The union must have been successfully decoded as a T.

Auto Trait Implementations§

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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

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>,

Source§

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.