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 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> 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<'_, Result<'_, T, E>>,
_: <Result<'_, T, E> as Constrained>::Constraint,
) -> Result<(), ValidationError>
fn validate( _: Slot<'_, Result<'_, T, E>>, _: <Result<'_, T, E> 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<'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>>,
_: (),
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut Enc, out: &mut MaybeUninit<Result<'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<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>>,
_: (),
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut Enc, out: &mut MaybeUninit<Result<'_, 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<Result<'_, WT, WE>> for Result<T, E>
impl<T, E, WT, WE> FromWire<Result<'_, WT, WE>> for Result<T, E>
Source§fn from_wire(wire: Result<'_, WT, WE>) -> Result<T, E>
fn from_wire(wire: Result<'_, WT, WE>) -> Result<T, E>
Converts the given owned value to this type.
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>) -> Result<T, E>
fn from_wire_ref(wire: &Result<'_, WT, WE>) -> Result<T, E>
Converts the given reference to this type.
Source§impl<T, E> IntoNatural for Result<'_, T, E>where
T: IntoNatural,
E: IntoNatural,
impl<T, E> IntoNatural for Result<'_, T, E>where
T: IntoNatural,
E: IntoNatural,
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> UnsafeUnpin 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
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