pub struct Flexible<'de, T> { /* private fields */ }Expand description
A flexible FIDL response.
Implementations§
Source§impl<T> Flexible<'_, T>
impl<T> Flexible<'_, T>
Sourcepub fn is_framework_err(&self) -> bool
pub fn is_framework_err(&self) -> bool
Returns whether the flexible response is FrameworkErr.
Sourcepub fn framework_err(&self) -> Option<FrameworkError>
pub fn framework_err(&self) -> Option<FrameworkError>
Returns the FrameworkErr value of the response, if any.
Sourcepub fn unwrap_framework_err(&self) -> FrameworkError
pub fn unwrap_framework_err(&self) -> FrameworkError
Returns the contained FrameworkErr value.
Panics if the response was not FrameworkErr.
Sourcepub fn as_ref(&self) -> Flexible<&T>
pub fn as_ref(&self) -> Flexible<&T>
Returns a Flexible of a reference to the value or framework error.
Sourcepub fn as_result(&self) -> Result<&T, FrameworkError>
pub fn as_result(&self) -> Result<&T, FrameworkError>
Returns a Result of the Ok value and a potential FrameworkError.
Sourcepub fn to_flexible(self) -> Flexible<T>
pub fn to_flexible(self) -> Flexible<T>
Returns a Flexible of an Owned value or framework error.
Trait Implementations§
Source§impl<T> Constrained for Flexible<'_, T>where
T: Constrained<Constraint = ()>,
impl<T> Constrained for Flexible<'_, T>where
T: Constrained<Constraint = ()>,
Source§type Constraint = ()
type Constraint = ()
Type of constraint information for this type.
Source§fn validate(
_: Slot<'_, Flexible<'_, T>>,
_: <Flexible<'_, T> as Constrained>::Constraint,
) -> Result<(), ValidationError>
fn validate( _: Slot<'_, Flexible<'_, T>>, _: <Flexible<'_, T> 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<'de, D, T> Decode<D> for Flexible<'de, T>
impl<'de, D, T> Decode<D> for Flexible<'de, T>
Source§fn decode(
slot: Slot<'_, Flexible<'de, T>>,
decoder: &mut D,
constraint: <Flexible<'de, T> as Constrained>::Constraint,
) -> Result<(), DecodeError>
fn decode( slot: Slot<'_, Flexible<'de, T>>, decoder: &mut D, constraint: <Flexible<'de, T> as Constrained>::Constraint, ) -> Result<(), DecodeError>
Decodes a value into a slot using a decoder. Read more
Source§impl<'a, E, WT, T> Encode<Flexible<'static, WT>, E> for &'a Flexible<T>
impl<'a, E, WT, T> Encode<Flexible<'static, WT>, E> for &'a Flexible<T>
Source§fn encode(
self,
encoder: &mut E,
out: &mut MaybeUninit<Flexible<'static, WT>>,
constraint: <WT as Constrained>::Constraint,
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut E, out: &mut MaybeUninit<Flexible<'static, WT>>, constraint: <WT as Constrained>::Constraint, ) -> Result<(), EncodeError>
Encodes this value into an encoder and output.
Source§const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
Source§impl<E, WT, T> Encode<Flexible<'static, WT>, E> for Flexible<T>
impl<E, WT, T> Encode<Flexible<'static, WT>, E> for Flexible<T>
Source§fn encode(
self,
encoder: &mut E,
out: &mut MaybeUninit<Flexible<'static, WT>>,
constraint: <WT as Constrained>::Constraint,
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut E, out: &mut MaybeUninit<Flexible<'static, WT>>, constraint: <WT as Constrained>::Constraint, ) -> Result<(), EncodeError>
Encodes this value into an encoder and output.
Source§const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
Source§impl<T, WT> FromWire<Flexible<'_, WT>> for Flexible<T>where
T: FromWire<WT>,
impl<T, WT> FromWire<Flexible<'_, WT>> for Flexible<T>where
T: FromWire<WT>,
Source§fn from_wire(wire: Flexible<'_, WT>) -> Flexible<T>
fn from_wire(wire: Flexible<'_, WT>) -> Flexible<T>
Converts the given owned value to this type.
Source§const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
Source§impl<T, WT> FromWireRef<Flexible<'_, WT>> for Flexible<T>where
T: FromWireRef<WT>,
impl<T, WT> FromWireRef<Flexible<'_, WT>> for Flexible<T>where
T: FromWireRef<WT>,
Source§fn from_wire_ref(wire: &Flexible<'_, WT>) -> Flexible<T>
fn from_wire_ref(wire: &Flexible<'_, WT>) -> Flexible<T>
Converts the given reference to this type.
Source§impl<T> IntoNatural for Flexible<'_, T>where
T: IntoNatural,
impl<T> IntoNatural for Flexible<'_, T>where
T: IntoNatural,
Source§type Natural = Flexible<<T as IntoNatural>::Natural>
type Natural = Flexible<<T as IntoNatural>::Natural>
A good default type for this wire type to convert into.
Source§fn into_natural(self) -> Self::Natural
fn into_natural(self) -> Self::Natural
Converts this type into its natural equivalent.
Auto Trait Implementations§
impl<'de, T> Freeze for Flexible<'de, T>
impl<'de, T> RefUnwindSafe for Flexible<'de, T>where
T: RefUnwindSafe,
impl<'de, T> Send for Flexible<'de, T>where
T: Send,
impl<'de, T> Sync for Flexible<'de, T>where
T: Sync,
impl<'de, T> Unpin for Flexible<'de, T>where
T: Unpin,
impl<'de, T> UnsafeUnpin for Flexible<'de, T>
impl<'de, T> !UnwindSafe for Flexible<'de, T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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
Converts the given service transport handle of type
T to Self