pub struct Union { /* private fields */ }Expand description
A raw FIDL union
Implementations§
Source§impl Union
impl Union
Sourcepub fn encode_absent(out: &mut MaybeUninit<Self>)
pub fn encode_absent(out: &mut MaybeUninit<Self>)
Encodes that a union is absent in a slot.
Sourcepub fn encode_as_static<E: InternalHandleEncoder + ?Sized, W: Wire>(
value: impl Encode<W, E>,
ord: u64,
encoder: &mut E,
out: &mut MaybeUninit<Self>,
constraint: W::Constraint,
) -> Result<(), EncodeError>
pub fn encode_as_static<E: InternalHandleEncoder + ?Sized, W: Wire>( value: impl Encode<W, E>, ord: u64, encoder: &mut E, out: &mut MaybeUninit<Self>, constraint: W::Constraint, ) -> Result<(), EncodeError>
Encodes a 'static value and ordinal in a slot.
Sourcepub fn encode_as<E: Encoder + ?Sized, W: Wire>(
value: impl Encode<W, E>,
ord: u64,
encoder: &mut E,
out: &mut MaybeUninit<Self>,
constraint: W::Constraint,
) -> Result<(), EncodeError>
pub fn encode_as<E: Encoder + ?Sized, W: Wire>( value: impl Encode<W, E>, ord: u64, encoder: &mut E, out: &mut MaybeUninit<Self>, constraint: W::Constraint, ) -> Result<(), EncodeError>
Encodes a value and ordinal in a slot.
Sourcepub fn encoded_ordinal(slot: Slot<'_, Self>) -> u64
pub fn encoded_ordinal(slot: Slot<'_, Self>) -> u64
Returns the ordinal of the encoded value.
Sourcepub fn decode_absent(slot: Slot<'_, Self>) -> Result<(), DecodeError>
pub fn decode_absent(slot: Slot<'_, Self>) -> Result<(), DecodeError>
Decodes an absent union from a slot.
Sourcepub fn decode_unknown_static<D: InternalHandleDecoder + ?Sized>(
slot: Slot<'_, Self>,
decoder: &mut D,
) -> Result<(), DecodeError>
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.
Sourcepub fn decode_unknown<'de, D: Decoder<'de> + ?Sized>(
slot: Slot<'_, Self>,
decoder: &mut D,
) -> Result<(), DecodeError>
pub fn decode_unknown<'de, D: Decoder<'de> + ?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.
Sourcepub fn decode_as_static<D: InternalHandleDecoder + ?Sized, T: Decode<D>>(
slot: Slot<'_, Self>,
decoder: &mut D,
constraint: T::Constraint,
) -> Result<(), DecodeError>
pub fn decode_as_static<D: InternalHandleDecoder + ?Sized, T: Decode<D>>( slot: Slot<'_, Self>, decoder: &mut D, constraint: T::Constraint, ) -> Result<(), DecodeError>
Decodes the typed 'static value in a union.
Sourcepub fn decode_as<'de, D: Decoder<'de> + ?Sized, T: Decode<D>>(
slot: Slot<'_, Self>,
decoder: &mut D,
constraint: T::Constraint,
) -> Result<(), DecodeError>
pub fn decode_as<'de, D: Decoder<'de> + ?Sized, T: Decode<D>>( slot: Slot<'_, Self>, decoder: &mut D, constraint: T::Constraint, ) -> Result<(), DecodeError>
Decodes the typed value in a union.
Sourcepub unsafe fn clone_inline_unchecked<T: Clone>(&self) -> Self
pub unsafe fn clone_inline_unchecked<T: Clone>(&self) -> Self
Clones the union, assuming that it contains an inline T.
§Safety
The union must have been successfully decoded inline as a T.
Trait Implementations§
Source§impl Constrained for Union
impl Constrained for Union
Source§type Constraint = ()
type Constraint = ()
Type of constraint information for this type.
Source§fn validate(
_: Slot<'_, Self>,
_: Self::Constraint,
) -> Result<(), ValidationError>
fn validate( _: Slot<'_, Self>, _: Self::Constraint, ) -> Result<(), ValidationError>
Validate a slot of this type against a constraint. Can be called when
pointers/envelopes are just presence markers.
Auto Trait Implementations§
impl Freeze for Union
impl RefUnwindSafe for Union
impl Send for Union
impl Sync for Union
impl Unpin for Union
impl UnwindSafe for Union
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