Enum rkyv_test::option::ArchivedOption
source · [−]#[repr(u8)]
pub enum ArchivedOption<T> {
None,
Some(T),
}
Expand description
Variants
None
No value
Some(T)
Some value T
Implementations
sourceimpl<T> ArchivedOption<T>
impl<T> ArchivedOption<T>
sourcepub fn as_pin_ref(self: Pin<&Self>) -> Option<Pin<&T>>
pub fn as_pin_ref(self: Pin<&Self>) -> Option<Pin<&T>>
Converts from Pin<&ArchivedOption<T>>
to Option<Pin<&T>>
.
sourcepub fn as_pin_mut(self: Pin<&mut Self>) -> Option<Pin<&mut T>>
pub fn as_pin_mut(self: Pin<&mut Self>) -> Option<Pin<&mut T>>
Converts from Pin<&mut ArchivedOption<T>>
to Option<Pin<&mut T>>
.
sourcepub const fn iter(&self) -> Iter<'_, T>ⓘNotable traits for Iter<'a, T>impl<'a, T> Iterator for Iter<'a, T> type Item = &'a T;
pub const fn iter(&self) -> Iter<'_, T>ⓘNotable traits for Iter<'a, T>impl<'a, T> Iterator for Iter<'a, T> type Item = &'a T;
Returns an iterator over the possibly contained value.
sourcepub fn iter_mut(&mut self) -> IterMut<'_, T>ⓘNotable traits for IterMut<'a, T>impl<'a, T> Iterator for IterMut<'a, T> type Item = &'a mut T;
pub fn iter_mut(&mut self) -> IterMut<'_, T>ⓘNotable traits for IterMut<'a, T>impl<'a, T> Iterator for IterMut<'a, T> type Item = &'a mut T;
Returns a mutable iterator over the possibly contained value.
sourcepub fn get_or_insert(&mut self, v: T) -> &mut T
pub fn get_or_insert(&mut self, v: T) -> &mut T
Inserts v
into the option if it is None
, then returns a mutable
reference to the contained value.
sourcepub fn get_or_insert_with<F: FnOnce() -> T>(&mut self, f: F) -> &mut T
pub fn get_or_insert_with<F: FnOnce() -> T>(&mut self, f: F) -> &mut T
Inserts a value computed from f
into the option if it is None
, then
returns a mutable reference to the contained value.
sourceimpl<T: Deref> ArchivedOption<T>
impl<T: Deref> ArchivedOption<T>
sourceimpl<T: DerefMut> ArchivedOption<T>
impl<T: DerefMut> ArchivedOption<T>
sourcepub fn as_deref_mut(&mut self) -> Option<&mut <T as Deref>::Target>
pub fn as_deref_mut(&mut self) -> Option<&mut <T as Deref>::Target>
Converts from &mut ArchivedOption<T>
to Option<&mut T::Target>
.
Leaves the original ArchivedOption
in-place, creating a new Option
with a mutable
reference to the inner type’s Deref::Target
type.
Trait Implementations
sourceimpl<__C: ?Sized, T> CheckBytes<__C> for ArchivedOption<T> where
T: CheckBytes<__C>,
impl<__C: ?Sized, T> CheckBytes<__C> for ArchivedOption<T> where
T: CheckBytes<__C>,
type Error = EnumCheckError<u8>
type Error = EnumCheckError<u8>
The error that may result from checking the type.
sourceunsafe 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
sourceimpl<T: Debug> Debug for ArchivedOption<T>
impl<T: Debug> Debug for ArchivedOption<T>
sourceimpl<T: Archive, D: Fallible + ?Sized> Deserialize<Option<T>, D> for ArchivedOption<T::Archived> where
T::Archived: Deserialize<T, D>,
impl<T: Archive, D: Fallible + ?Sized> Deserialize<Option<T>, D> for ArchivedOption<T::Archived> where
T::Archived: Deserialize<T, D>,
sourceimpl<A, O, D> DeserializeWith<ArchivedOption<<A as ArchiveWith<O>>::Archived>, Option<O>, D> for Map<A> where
D: Fallible,
A: ArchiveWith<O> + DeserializeWith<<A as ArchiveWith<O>>::Archived, O, D>,
impl<A, O, D> DeserializeWith<ArchivedOption<<A as ArchiveWith<O>>::Archived>, Option<O>, D> for Map<A> where
D: Fallible,
A: ArchiveWith<O> + DeserializeWith<<A as ArchiveWith<O>>::Archived, O, D>,
sourcefn deserialize_with(
field: &ArchivedOption<<A as ArchiveWith<O>>::Archived>,
d: &mut D
) -> Result<Option<O>, D::Error>
fn deserialize_with(
field: &ArchivedOption<<A as ArchiveWith<O>>::Archived>,
d: &mut D
) -> Result<Option<O>, D::Error>
Deserializes the field type F
using the given deserializer.
sourceimpl<T: Hash> Hash for ArchivedOption<T>
impl<T: Hash> Hash for ArchivedOption<T>
sourceimpl<T: Ord> Ord for ArchivedOption<T>
impl<T: Ord> Ord for ArchivedOption<T>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq> PartialEq<ArchivedOption<T>> for ArchivedOption<T>
impl<T: PartialEq> PartialEq<ArchivedOption<T>> for ArchivedOption<T>
sourceimpl<T: PartialEq<U>, U> PartialEq<ArchivedOption<T>> for Option<U>
impl<T: PartialEq<U>, U> PartialEq<ArchivedOption<T>> for Option<U>
sourcefn eq(&self, other: &ArchivedOption<T>) -> bool
fn eq(&self, other: &ArchivedOption<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl<T, U: PartialEq<T>> PartialEq<Option<T>> for ArchivedOption<U>
impl<T, U: PartialEq<T>> PartialEq<Option<T>> for ArchivedOption<U>
sourceimpl<T: PartialOrd> PartialOrd<ArchivedOption<T>> for ArchivedOption<T>
impl<T: PartialOrd> PartialOrd<ArchivedOption<T>> for ArchivedOption<T>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<T: Eq> Eq for ArchivedOption<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for ArchivedOption<T> where
T: RefUnwindSafe,
impl<T> Send for ArchivedOption<T> where
T: Send,
impl<T> Sync for ArchivedOption<T> where
T: Sync,
impl<T> Unpin for ArchivedOption<T> where
T: Unpin,
impl<T> UnwindSafe for ArchivedOption<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
sourcefn 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.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more