pub union Envelope {
/* private fields */
}Expand description
A FIDL envelope
Implementations§
Source§impl Envelope
impl Envelope
Sourcepub fn encode_zero(out: &mut MaybeUninit<Envelope>)
pub fn encode_zero(out: &mut MaybeUninit<Envelope>)
Encodes a zero envelope into a slot.
Sourcepub 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>
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.
Sourcepub fn encode_value<W, E>(
value: impl Encode<W, E>,
encoder: &mut E,
out: &mut MaybeUninit<Envelope>,
constraint: <W as Constrained>::Constraint,
) -> Result<(), EncodeError>
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>
Encodes a value into an envelope with an encoder.
Sourcepub fn is_encoded_zero(slot: Slot<'_, Envelope>) -> bool
pub fn is_encoded_zero(slot: Slot<'_, Envelope>) -> bool
Returns whether a envelope slot is encoded as zero.
Sourcepub fn decode_unknown_static<D>(
slot: Slot<'_, Envelope>,
decoder: &mut D,
) -> Result<(), DecodeError>where
D: InternalHandleDecoder + ?Sized,
pub fn decode_unknown_static<D>(
slot: Slot<'_, Envelope>,
decoder: &mut D,
) -> Result<(), DecodeError>where
D: InternalHandleDecoder + ?Sized,
Decodes and discards a static type in an envelope.
Sourcepub fn decode_unknown<'de, D>(
slot: Slot<'_, Envelope>,
decoder: &mut D,
) -> Result<(), DecodeError>
pub fn decode_unknown<'de, D>( slot: Slot<'_, Envelope>, decoder: &mut D, ) -> Result<(), DecodeError>
Decodes and discards an unknown value in an envelope.
Sourcepub fn decode_as_static<D, T>(
slot: Slot<'_, Envelope>,
decoder: &mut D,
constraint: <T as Constrained>::Constraint,
) -> Result<(), DecodeError>
pub fn decode_as_static<D, T>( slot: Slot<'_, Envelope>, decoder: &mut D, constraint: <T as Constrained>::Constraint, ) -> Result<(), DecodeError>
Decodes a value of a known type from an envelope.
Sourcepub fn decode_as<'de, D, T>(
slot: Slot<'_, Envelope>,
decoder: &mut D,
constraint: <T as Constrained>::Constraint,
) -> Result<(), DecodeError>
pub fn decode_as<'de, D, T>( slot: Slot<'_, Envelope>, decoder: &mut D, constraint: <T as Constrained>::Constraint, ) -> Result<(), DecodeError>
Decodes a value of a known type from an envelope.
Sourcepub unsafe fn as_ptr<T>(this: *mut Envelope) -> *mut T
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.
Sourcepub unsafe fn deref_unchecked<T>(&self) -> &T
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.
Sourcepub unsafe fn read_unchecked<T>(&self) -> T
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.
Sourcepub unsafe fn take_unchecked<T>(&mut self) -> T
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.
Sourcepub unsafe fn clone_inline_unchecked<T>(&self) -> Envelopewhere
T: Clone,
pub unsafe fn clone_inline_unchecked<T>(&self) -> Envelopewhere
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
impl Constrained for Envelope
Source§type Constraint = ()
type Constraint = ()
Source§fn validate(
_: Slot<'_, Envelope>,
_: <Envelope as Constrained>::Constraint,
) -> Result<(), ValidationError>
fn validate( _: Slot<'_, Envelope>, _: <Envelope as Constrained>::Constraint, ) -> Result<(), ValidationError>
Source§impl Wire for Envelope
impl Wire for Envelope
Source§fn zero_padding(_: &mut MaybeUninit<Envelope>)
fn zero_padding(_: &mut MaybeUninit<Envelope>)
impl Send for Envelope
impl Sync for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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
Source§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to Self