pub struct WireResult<'de, T, E> { /* private fields */ }Expand description
A FIDL result union.
Implementations§
Source§impl<T, E> WireResult<'_, T, E>
impl<T, E> WireResult<'_, T, E>
Sourcepub fn unwrap_err(&self) -> &E
pub fn unwrap_err(&self) -> &E
Returns the contained Err value.
Panics if the result was not Err.
Sourcepub fn into_result(self) -> Result<T, E>
pub fn into_result(self) -> Result<T, E>
Returns a Result of the owned value or error.
Trait Implementations§
Source§impl<T, E> Debug for WireResult<'_, T, E>
impl<T, E> Debug for WireResult<'_, T, E>
Source§impl<D, T, E> Decode<D> for WireResult<'static, T, E>where
D: Decoder + ?Sized,
T: Decode<D> + Constrained<Constraint = ()>,
E: Decode<D> + Constrained<Constraint = ()>,
impl<D, T, E> Decode<D> for WireResult<'static, T, E>where
D: Decoder + ?Sized,
T: Decode<D> + Constrained<Constraint = ()>,
E: Decode<D> + Constrained<Constraint = ()>,
Source§impl<T, E> Drop for WireResult<'_, T, E>
impl<T, E> Drop for WireResult<'_, T, E>
Source§impl<'a, Enc, WT, T, WE, E> Encode<WireResult<'static, WT, WE>, Enc> for &'a Result<T, E>
impl<'a, Enc, WT, T, WE, E> Encode<WireResult<'static, WT, WE>, Enc> for &'a Result<T, E>
Source§fn encode(
self,
encoder: &mut Enc,
out: &mut MaybeUninit<WireResult<'static, WT, WE>>,
_: (),
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut Enc, out: &mut MaybeUninit<WireResult<'static, WT, WE>>, _: (), ) -> 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<Enc, WT, T, WE, E> Encode<WireResult<'static, WT, WE>, Enc> for Result<T, E>where
Enc: Encoder + ?Sized,
WT: Constrained<Constraint = ()> + Wire,
T: Encode<WT, Enc>,
WE: Constrained<Constraint = ()> + Wire,
E: Encode<WE, Enc>,
impl<Enc, WT, T, WE, E> Encode<WireResult<'static, WT, WE>, Enc> for Result<T, E>where
Enc: Encoder + ?Sized,
WT: Constrained<Constraint = ()> + Wire,
T: Encode<WT, Enc>,
WE: Constrained<Constraint = ()> + Wire,
E: Encode<WE, Enc>,
Source§fn encode(
self,
encoder: &mut Enc,
out: &mut MaybeUninit<WireResult<'static, WT, WE>>,
_: (),
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut Enc, out: &mut MaybeUninit<WireResult<'static, WT, WE>>, _: (), ) -> 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, E, WT, WE> FromWire<WireResult<'_, WT, WE>> for Result<T, E>
impl<T, E, WT, WE> FromWire<WireResult<'_, WT, WE>> for Result<T, E>
Source§fn from_wire(wire: WireResult<'_, WT, WE>) -> Self
fn from_wire(wire: WireResult<'_, WT, WE>) -> Self
Converts the given
wire to this type.Source§const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
Source§impl<T, E, WT, WE> FromWireRef<WireResult<'_, WT, WE>> for Result<T, E>where
T: FromWireRef<WT>,
E: FromWireRef<WE>,
impl<T, E, WT, WE> FromWireRef<WireResult<'_, WT, WE>> for Result<T, E>where
T: FromWireRef<WT>,
E: FromWireRef<WE>,
Source§fn from_wire_ref(wire: &WireResult<'_, WT, WE>) -> Self
fn from_wire_ref(wire: &WireResult<'_, WT, WE>) -> Self
Converts the given
wire reference to this type.Source§impl<T: IntoNatural, E: IntoNatural> IntoNatural for WireResult<'_, T, E>
impl<T: IntoNatural, E: IntoNatural> IntoNatural for WireResult<'_, T, E>
Source§type Natural = Result<<T as IntoNatural>::Natural, <E as IntoNatural>::Natural>
type Natural = Result<<T as IntoNatural>::Natural, <E 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.
Source§impl<T: Wire, E: Wire> Wire for WireResult<'static, T, E>
impl<T: Wire, E: Wire> Wire for WireResult<'static, T, E>
Source§type Owned<'de> = WireResult<'de, <T as Wire>::Owned<'de>, <E as Wire>::Owned<'de>>
type Owned<'de> = WireResult<'de, <T as Wire>::Owned<'de>, <E as Wire>::Owned<'de>>
The owned wire type, restricted to the
'de lifetime.Source§fn zero_padding(out: &mut MaybeUninit<Self>)
fn zero_padding(out: &mut MaybeUninit<Self>)
Writes zeroes to the padding for this type, if any.
impl<T: Constrained<Constraint = ()>, E: Constrained<Constraint = ()>> Unconstrained for WireResult<'_, T, E>
Auto Trait Implementations§
impl<'de, T, E> Freeze for WireResult<'de, T, E>
impl<'de, T, E> RefUnwindSafe for WireResult<'de, T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<'de, T, E> Send for WireResult<'de, T, E>
impl<'de, T, E> Sync for WireResult<'de, T, E>
impl<'de, T, E> Unpin for WireResult<'de, T, E>
impl<'de, T, E> !UnwindSafe for WireResult<'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