Struct WireFlexibleResult
pub struct WireFlexibleResult<'de, T, E> { /* private fields */ }
Expand description
A flexible FIDL result.
Implementations§
§impl<'de, T, E> WireFlexibleResult<'de, T, E>
impl<'de, T, E> WireFlexibleResult<'de, T, E>
pub fn is_framework_err(&self) -> bool
pub fn is_framework_err(&self) -> bool
Returns whether the flexible result is FrameworkErr
.
pub fn framework_err(&self) -> Option<FrameworkError>
pub fn framework_err(&self) -> Option<FrameworkError>
Returns the FrameworkErr
value of the result, if any.
pub fn unwrap_err(&self) -> &E
pub fn unwrap_err(&self) -> &E
Returns the contained Err
value.
Panics if the result was not Err
.
pub fn unwrap_framework_err(&self) -> FrameworkError
pub fn unwrap_framework_err(&self) -> FrameworkError
Returns the contained FrameworkErr
value.
Panics if the result was not FrameworkErr
.
pub fn as_ref(&self) -> FlexibleResult<&T, &E>
pub fn as_ref(&self) -> FlexibleResult<&T, &E>
Returns a FlexibleResult
of a reference to the value or framework error.
pub fn as_response(&self) -> Result<&WireResult<'_, T, E>, FrameworkError>
pub fn as_response(&self) -> Result<&WireResult<'_, T, E>, FrameworkError>
Returns a Result
of the Ok
value and a potential FrameworkError
.
pub fn as_result(&self) -> Result<Result<&T, &E>, FrameworkError>
pub fn as_result(&self) -> Result<Result<&T, &E>, FrameworkError>
Returns a nested Result
of the Ok
and Err
values, and a potential FrameworkError
.
pub fn to_flexible_result(self) -> FlexibleResult<T, E>
pub fn to_flexible_result(self) -> FlexibleResult<T, E>
Returns a FlexibleResult
of a value or framework error.
Trait Implementations§
§impl<T, E> Debug for WireFlexibleResult<'_, T, E>
impl<T, E> Debug for WireFlexibleResult<'_, T, E>
§impl<D, T, E> Decode<D> for WireFlexibleResult<'static, T, E>
impl<D, T, E> Decode<D> for WireFlexibleResult<'static, T, E>
§fn decode(
slot: Slot<'_, WireFlexibleResult<'static, T, E>>,
decoder: &mut D,
) -> Result<(), DecodeError>
fn decode( slot: Slot<'_, WireFlexibleResult<'static, T, E>>, decoder: &mut D, ) -> Result<(), DecodeError>
Decodes a value into a slot using a decoder. Read more
§impl<T, WT, E, WE> FromWire<WireFlexibleResult<'_, WT, WE>> for FlexibleResult<T, E>
impl<T, WT, E, WE> FromWire<WireFlexibleResult<'_, WT, WE>> for FlexibleResult<T, E>
§fn from_wire(wire: WireFlexibleResult<'_, WT, WE>) -> FlexibleResult<T, E>
fn from_wire(wire: WireFlexibleResult<'_, WT, WE>) -> FlexibleResult<T, E>
Converts the given
wire
to this type.§const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
§impl<T, WT, E, WE> FromWireRef<WireFlexibleResult<'_, WT, WE>> for FlexibleResult<T, E>where
T: FromWireRef<WT>,
E: FromWireRef<WE>,
impl<T, WT, E, WE> FromWireRef<WireFlexibleResult<'_, WT, WE>> for FlexibleResult<T, E>where
T: FromWireRef<WT>,
E: FromWireRef<WE>,
§fn from_wire_ref(wire: &WireFlexibleResult<'_, WT, WE>) -> FlexibleResult<T, E>
fn from_wire_ref(wire: &WireFlexibleResult<'_, WT, WE>) -> FlexibleResult<T, E>
Converts the given
wire
reference to this type.§impl<T, E> Wire for WireFlexibleResult<'static, T, E>
impl<T, E> Wire for WireFlexibleResult<'static, T, E>
§type Decoded<'de> = WireFlexibleResult<'de, <T as Wire>::Decoded<'de>, <E as Wire>::Decoded<'de>>
type Decoded<'de> = WireFlexibleResult<'de, <T as Wire>::Decoded<'de>, <E as Wire>::Decoded<'de>>
The decoded wire type, restricted to the
'de
lifetime.§fn zero_padding(out: &mut MaybeUninit<WireFlexibleResult<'static, T, E>>)
fn zero_padding(out: &mut MaybeUninit<WireFlexibleResult<'static, T, E>>)
Writes zeroes to the padding for this type, if any.
Auto Trait Implementations§
impl<'de, T, E> Freeze for WireFlexibleResult<'de, T, E>
impl<'de, T, E> RefUnwindSafe for WireFlexibleResult<'de, T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<'de, T, E> !Send for WireFlexibleResult<'de, T, E>
impl<'de, T, E> !Sync for WireFlexibleResult<'de, T, E>
impl<'de, T, E> Unpin for WireFlexibleResult<'de, T, E>
impl<'de, T, E> !UnwindSafe for WireFlexibleResult<'de, T, E>
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