#[repr(u8)]pub enum ArchivedResult<T, E> {
Ok(T),
Err(E),
}
Variants§
Implementations§
Source§impl<T, E> ArchivedResult<T, E>
impl<T, E> ArchivedResult<T, E>
Sourcepub fn unwrap_or_else<F>(self, op: F) -> Twhere
F: FnOnce(E) -> T,
pub fn unwrap_or_else<F>(self, op: F) -> Twhere
F: FnOnce(E) -> T,
Returns the contained Ok
value or computes it from a closure.
Sourcepub fn as_ref(&self) -> Result<&T, &E>
pub fn as_ref(&self) -> Result<&T, &E>
Returns a Result
containing the success and error values of this
ArchivedResult
.
Sourcepub fn as_mut(&mut self) -> Result<&mut T, &mut E>
pub fn as_mut(&mut self) -> Result<&mut T, &mut E>
Converts from &mut ArchivedResult<T, E>
to Result<&mut T, &mut E>
.
Sourcepub fn as_seal(this: Seal<'_, Self>) -> Result<Seal<'_, T>, Seal<'_, E>>
pub fn as_seal(this: Seal<'_, Self>) -> Result<Seal<'_, T>, Seal<'_, E>>
Converts from Seal<'_, ArchivedResult<T, E>>
to
Result<Seal<'_, T>, Seal<'_, E>>
.
Sourcepub fn iter(&self) -> Iter<&T>
pub fn iter(&self) -> Iter<&T>
Returns an iterator over the possibly-contained value.
The iterator yields one value if the result is ArchivedResult::Ok
,
otherwise none.
Source§impl<T: Deref, E> ArchivedResult<T, E>
impl<T: Deref, E> ArchivedResult<T, E>
Source§impl<T: DerefMut, E> ArchivedResult<T, E>
impl<T: DerefMut, E> ArchivedResult<T, E>
Trait Implementations§
Source§impl<T, E, __C: Fallible + ?Sized> CheckBytes<__C> for ArchivedResult<T, E>
impl<T, E, __C: Fallible + ?Sized> CheckBytes<__C> for ArchivedResult<T, E>
Source§impl<T, U, D> Deserialize<Result<T, U>, D> for ArchivedResult<T::Archived, U::Archived>where
T: Archive,
U: Archive,
D: Fallible + ?Sized,
T::Archived: Deserialize<T, D>,
U::Archived: Deserialize<U, D>,
impl<T, U, D> Deserialize<Result<T, U>, D> for ArchivedResult<T::Archived, U::Archived>where
T: Archive,
U: Archive,
D: Fallible + ?Sized,
T::Archived: Deserialize<T, D>,
U::Archived: Deserialize<U, D>,
Source§impl<T: Ord, E: Ord> Ord for ArchivedResult<T, E>
impl<T: Ord, E: Ord> Ord for ArchivedResult<T, E>
Source§impl<T, U, E, F> PartialEq<Result<T, E>> for ArchivedResult<U, F>
impl<T, U, E, F> PartialEq<Result<T, E>> for ArchivedResult<U, F>
Source§impl<T: PartialOrd, E: PartialOrd> PartialOrd for ArchivedResult<T, E>
impl<T: PartialOrd, E: PartialOrd> PartialOrd for ArchivedResult<T, E>
impl<T: Eq, E: Eq> Eq for ArchivedResult<T, E>
impl<T, E> Portable for ArchivedResult<T, E>
Auto Trait Implementations§
impl<T, E> Freeze for ArchivedResult<T, E>
impl<T, E> RefUnwindSafe for ArchivedResult<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for ArchivedResult<T, E>
impl<T, E> Sync for ArchivedResult<T, E>
impl<T, E> Unpin for ArchivedResult<T, E>
impl<T, E> UnwindSafe for ArchivedResult<T, E>where
T: UnwindSafe,
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out
indicating that a T
is niched.