Skip to main content

Envelope

Union Envelope 

Source
pub union Envelope {
    /* private fields */
}
Expand description

A FIDL envelope

Implementations§

Source§

impl Envelope

Source

pub fn encode_zero(out: &mut MaybeUninit<Envelope>)

Encodes a zero envelope into a slot.

Source

pub fn encode_value_static<W, E>( value: impl Encode<W, E>, encoder: &mut E, out: &mut MaybeUninit<Envelope>, constraint: <W as Constrained>::Constraint, ) -> Result<(), EncodeError>

Encodes a 'static value into an envelope with an encoder.

Source

pub fn encode_value<W, E>( value: impl Encode<W, E>, encoder: &mut E, out: &mut MaybeUninit<Envelope>, constraint: <W as Constrained>::Constraint, ) -> Result<(), EncodeError>
where W: Wire, E: Encoder + ?Sized,

Encodes a value into an envelope with an encoder.

Source

pub fn zero() -> Envelope

Returns the zero envelope.

Source

pub fn is_encoded_zero(slot: Slot<'_, Envelope>) -> 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_static<D>( slot: Slot<'_, Envelope>, decoder: &mut D, ) -> Result<(), DecodeError>

Decodes and discards a static type in an envelope.

Source

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

Decodes and discards an unknown value in an envelope.

Source

pub fn decode_as_static<D, T>( slot: Slot<'_, Envelope>, decoder: &mut D, constraint: <T as Constrained>::Constraint, ) -> Result<(), DecodeError>
where D: InternalHandleDecoder + ?Sized, T: Decode<D>,

Decodes a value of a known type from an envelope.

Source

pub fn decode_as<'de, D, T>( slot: Slot<'_, Envelope>, decoder: &mut D, constraint: <T as Constrained>::Constraint, ) -> Result<(), DecodeError>
where D: Decoder<'de> + ?Sized, T: Decode<D>,

Decodes a value of a known type from an envelope.

Source

pub unsafe fn as_ptr<T>(this: *mut Envelope) -> *mut T

Returns a pointer to the value contained in the envelope.

§Safety

this must point to a valid envelope that was successfully decoded.

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 read_unchecked<T>(&self) -> T

Returns the contained T.

§Safety

The envelope must have been successfully decoded as a T. Reading from an envelope can cause undefined behavior if the underlying value is dropped later. Precautions should be taken to ensure that values read from an envelope are not dropped twice.

Source

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

Takes the contained T out of the envelope.

§Safety

The envelope must have been successfully decoded as a T.

Source

pub unsafe fn clone_inline_unchecked<T>(&self) -> Envelope
where T: Clone,

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

§Safety

The envelope must have been successfully decoded inline as a T.

Trait Implementations§

Source§

impl Constrained for Envelope

Source§

type Constraint = ()

Type of constraint information for this type.
Source§

fn validate( _: Slot<'_, Envelope>, _: <Envelope as Constrained>::Constraint, ) -> Result<(), ValidationError>

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

impl Wire for Envelope

Source§

type Narrowed<'de> = Envelope

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

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

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

impl Send for Envelope

Source§

impl Sync for Envelope

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> InstanceFromServiceTransport<T> for T

Source§

fn from_service_transport(handle: T) -> T

Converts the given service transport handle of type T to Self
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.
Source§

impl<E> RunsTransport<Mpsc> for E

Source§

impl<E> RunsTransport<Mpsc> for E
where E: RunsTransport<Mpsc>,