Enum rkyv::result::ArchivedResult
source · #[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>
.
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<__C: ?Sized, T, E> CheckBytes<__C> for ArchivedResult<T, E>where
T: CheckBytes<__C>,
E: CheckBytes<__C>,
impl<__C: ?Sized, T, E> CheckBytes<__C> for ArchivedResult<T, E>where
T: CheckBytes<__C>,
E: CheckBytes<__C>,
§type Error = EnumCheckError<u8>
type Error = EnumCheckError<u8>
The error that may result from checking the type.
source§unsafe fn check_bytes<'__bytecheck>(
value: *const Self,
context: &mut __C,
) -> Result<&'__bytecheck Self, EnumCheckError<u8>>
unsafe fn check_bytes<'__bytecheck>( value: *const Self, context: &mut __C, ) -> Result<&'__bytecheck Self, EnumCheckError<u8>>
Checks whether the given pointer points to a valid value within the
given context. Read more
source§impl<T, E, D> Deserialize<Result<T, E>, D> for ArchivedResult<T::Archived, E::Archived>where
T: Archive,
E: Archive,
D: Fallible + ?Sized,
T::Archived: Deserialize<T, D>,
E::Archived: Deserialize<E, D>,
impl<T, E, D> Deserialize<Result<T, E>, D> for ArchivedResult<T::Archived, E::Archived>where
T: Archive,
E: Archive,
D: Fallible + ?Sized,
T::Archived: Deserialize<T, D>,
E::Archived: Deserialize<E, 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: PartialEq<U>, U, E: PartialEq<F>, F> PartialEq<ArchivedResult<T, E>> for Result<U, F>
impl<T: PartialEq<U>, U, E: PartialEq<F>, F> PartialEq<ArchivedResult<T, E>> for Result<U, F>
source§impl<T, U: PartialEq<T>, E, F: PartialEq<E>> PartialEq<Result<T, E>> for ArchivedResult<U, F>
impl<T, U: PartialEq<T>, E, F: PartialEq<E>> 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>
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
§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<T> CallHasher for T
impl<T> CallHasher for T
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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>
Gets the layout of the type.