WireBox

Struct WireBox 

Source
pub struct WireBox<'de, T> { /* private fields */ }
Expand description

A boxed (optional) FIDL value.

Implementations§

Source§

impl<T> WireBox<'_, T>

Source

pub fn encode_present(out: &mut MaybeUninit<Self>)

Encodes that a value is present in an output.

Source

pub fn encode_absent(out: &mut MaybeUninit<Self>)

Encodes that a value is absent in a slot.

Source

pub fn is_some(&self) -> bool

Returns whether the value is present.

Source

pub fn is_none(&self) -> bool

Returns whether the value is absent.

Source

pub fn as_ref(&self) -> Option<&T>

Returns a reference to the boxed value, if any.

Source

pub fn into_option(self) -> Option<T>

Returns an Owned of the boxed value, if any.

Trait Implementations§

Source§

impl<T: Constrained> Constrained for WireBox<'_, T>

Source§

type Constraint = <T as Constrained>::Constraint

Type of constraint information for this type.
Source§

fn validate( slot: Slot<'_, Self>, constraint: Self::Constraint, ) -> Result<(), ValidationError>

Validate a value of this type against a constraint. Can be called when pointers/envelopes are just presence markers.
Source§

impl<T: Debug> Debug for WireBox<'_, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<D: Decoder + ?Sized, T: Decode<D>> Decode<D> for WireBox<'static, T>

Source§

fn decode( slot: Slot<'_, Self>, decoder: &mut D, constraint: <Self as Constrained>::Constraint, ) -> Result<(), DecodeError>

Decodes a value into a slot using a decoder. Read more
Source§

impl<T> Drop for WireBox<'_, T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, ()>, E> for &()

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, ()>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, ()>, E> for ()

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, ()>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireF32>, E> for &WireF32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireF32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireF32>, E> for &f32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireF32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireF32>, E> for WireF32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireF32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireF32>, E> for f32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireF32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireF64>, E> for &WireF64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireF64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireF64>, E> for &f64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireF64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireF64>, E> for WireF64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireF64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireF64>, E> for f64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireF64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI16>, E> for &WireI16

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI16>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI16>, E> for &i16

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI16>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI16>, E> for WireI16

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI16>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI16>, E> for i16

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI16>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI32>, E> for &WireI32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI32>, E> for &i32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI32>, E> for WireI32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI32>, E> for i32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI64>, E> for &WireI64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI64>, E> for &i64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI64>, E> for WireI64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireI64>, E> for i64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireI64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU16>, E> for &WireU16

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU16>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU16>, E> for &u16

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU16>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU16>, E> for WireU16

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU16>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU16>, E> for u16

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU16>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU32>, E> for &WireU32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU32>, E> for &u32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU32>, E> for WireU32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU32>, E> for u32

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU32>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU64>, E> for &WireU64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU64>, E> for &u64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU64>, E> for WireU64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, WireU64>, E> for u64

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, WireU64>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, bool>, E> for &bool

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, bool>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, bool>, E> for bool

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, bool>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, i8>, E> for &i8

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, i8>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, i8>, E> for i8

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, i8>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, u8>, E> for &u8

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, u8>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<E: Encoder + ?Sized> EncodeOption<WireBox<'static, u8>, E> for u8

Source§

fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<WireBox<'static, u8>>, constraint: (), ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.
Source§

impl<T: IntoNatural> IntoNatural for WireBox<'_, T>

Source§

type Natural = Option<<T as IntoNatural>::Natural>

A good default type for this wire type to convert into.
Source§

fn into_natural(self) -> Self::Natural

Converts this type into its natural equivalent.
Source§

impl<T: Wire> Wire for WireBox<'static, T>

Source§

type Decoded<'de> = WireBox<'de, <T as Wire>::Decoded<'de>>

The decoded wire type, restricted to the 'de lifetime.
Source§

fn zero_padding(_: &mut MaybeUninit<Self>)

Writes zeroes to the padding for this type, if any.
Source§

impl<T: Send> Send for WireBox<'_, T>

Source§

impl<T: Sync> Sync for WireBox<'_, T>

Auto Trait Implementations§

§

impl<'de, T> Freeze for WireBox<'de, T>

§

impl<'de, T> RefUnwindSafe for WireBox<'de, T>
where T: RefUnwindSafe,

§

impl<'de, T> Unpin for WireBox<'de, T>

§

impl<'de, T> !UnwindSafe for WireBox<'de, T>

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, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> FromWireOption<WireBox<'_, W>> for T
where T: FromWire<W>,

Source§

fn from_wire_option(wire: WireBox<'_, W>) -> Option<T>

Converts the given wire to an option of this type.
Source§

impl<T, W> FromWireOptionRef<WireBox<'_, W>> for T
where T: FromWireRef<W>,

Source§

fn from_wire_option_ref(wire: &WireBox<'_, W>) -> Option<T>

Converts the given wire reference to an option of this type.
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.