pub struct Result<'de, T, E> { /* private fields */ }Expand description
A FIDL result union.
Implementations§
Source§impl<T, E> Result<'_, T, E>
impl<T, E> Result<'_, 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 as_ref(&self) -> CoreResult<&T, &E>
pub fn as_ref(&self) -> CoreResult<&T, &E>
Returns a Result of a reference to the value or error.
Sourcepub fn into_result(self) -> CoreResult<T, E>
pub fn into_result(self) -> CoreResult<T, E>
Returns a Result of the owned value or error.
Trait Implementations§
Source§impl<T, E> Constrained for Result<'_, T, E>
impl<T, E> Constrained for Result<'_, T, E>
Source§type Constraint = ()
type Constraint = ()
Type of constraint information for this type.
Source§fn validate(
_: Slot<'_, Self>,
_: Self::Constraint,
) -> CoreResult<(), ValidationError>
fn validate( _: Slot<'_, Self>, _: Self::Constraint, ) -> CoreResult<(), 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, E> Decode<D> for Result<'de, T, E>
impl<'de, D, T, E> Decode<D> for Result<'de, T, E>
Source§fn decode(
slot: Slot<'_, Self>,
decoder: &mut D,
_: (),
) -> CoreResult<(), DecodeError>
fn decode( slot: Slot<'_, Self>, decoder: &mut D, _: (), ) -> CoreResult<(), DecodeError>
Decodes a value into a slot using a decoder. Read more
Source§impl<'a, Enc, WT, T, WE, E> Encode<Result<'static, WT, WE>, Enc> for &'a Result<T, E>
impl<'a, Enc, WT, T, WE, E> Encode<Result<'static, WT, WE>, Enc> for &'a Result<T, E>
Source§fn encode(
self,
encoder: &mut Enc,
out: &mut MaybeUninit<Result<'static, WT, WE>>,
_: (),
) -> CoreResult<(), EncodeError>
fn encode( self, encoder: &mut Enc, out: &mut MaybeUninit<Result<'static, WT, WE>>, _: (), ) -> CoreResult<(), 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<Result<'static, WT, WE>, Enc> for Result<T, E>
impl<Enc, WT, T, WE, E> Encode<Result<'static, WT, WE>, Enc> for Result<T, E>
Source§fn encode(
self,
encoder: &mut Enc,
out: &mut MaybeUninit<Result<'_, WT, WE>>,
_: (),
) -> CoreResult<(), EncodeError>
fn encode( self, encoder: &mut Enc, out: &mut MaybeUninit<Result<'_, WT, WE>>, _: (), ) -> CoreResult<(), 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<Result<'_, WT, WE>> for Result<T, E>
impl<T, E, WT, WE> FromWire<Result<'_, WT, WE>> for Result<T, E>
Source§const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
Source§impl<T, E, WT, WE> FromWireRef<Result<'_, WT, WE>> for Result<T, E>where
T: FromWireRef<WT>,
E: FromWireRef<WE>,
impl<T, E, WT, WE> FromWireRef<Result<'_, WT, WE>> for Result<T, E>where
T: FromWireRef<WT>,
E: FromWireRef<WE>,
Source§fn from_wire_ref(wire: &Result<'_, WT, WE>) -> Self
fn from_wire_ref(wire: &Result<'_, WT, WE>) -> Self
Converts the given reference to this type.
Source§impl<T: IntoNatural, E: IntoNatural> IntoNatural for Result<'_, T, E>
impl<T: IntoNatural, E: IntoNatural> IntoNatural for Result<'_, 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.
Auto Trait Implementations§
impl<'de, T, E> Freeze for Result<'de, T, E>
impl<'de, T, E> RefUnwindSafe for Result<'de, T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<'de, T, E> Send for Result<'de, T, E>
impl<'de, T, E> Sync for Result<'de, T, E>
impl<'de, T, E> Unpin for Result<'de, T, E>
impl<'de, T, E> !UnwindSafe for Result<'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