[−][src]Enum rkyv::core_impl::ArchivedOption
An archived Option
.
It functions identically to Option
but has a different internal
representation to allow for archiving.
Variants
No value
Some value T
Implementations
impl<T> ArchivedOption<T>
[src]
pub fn is_none(&self) -> bool
[src]
Returns true
if the option is a None
value.
pub fn is_some(&self) -> bool
[src]
Returns true
if the option is a Some
value.
pub fn as_ref(&self) -> Option<&T>
[src]
Converts to an Option<&T>
.
pub fn as_mut(&mut self) -> Option<&mut T>
[src]
Converts to an Option<&mut T>
.
pub fn get_or_insert(&mut self, v: T) -> &mut T
[src]
Inserts v
into the option if it is None
, then returns a mutable
reference to the contained value.
pub fn get_or_insert_with<F: FnOnce() -> T>(&mut self, f: F) -> &mut T
[src]
Inserts a value computed from f
into the option if it is None
, then
returns a mutable reference to the contained value.
Trait Implementations
impl<T: Debug> Debug for ArchivedOption<T>
[src]
impl<T: Eq> Eq for ArchivedOption<T>
[src]
impl<T: Hash> Hash for ArchivedOption<T>
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Ord> Ord for ArchivedOption<T>
[src]
pub fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq> PartialEq<ArchivedOption<T>> for ArchivedOption<T>
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: PartialEq<U>, U> PartialEq<ArchivedOption<T>> for Option<U>
[src]
pub fn eq(&self, other: &ArchivedOption<T>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T, U: PartialEq<T>> PartialEq<Option<T>> for ArchivedOption<U>
[src]
pub fn eq(&self, other: &Option<T>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: PartialOrd> PartialOrd<ArchivedOption<T>> for ArchivedOption<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for ArchivedOption<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for ArchivedOption<T> where
T: Send,
T: Send,
impl<T> Sync for ArchivedOption<T> where
T: Sync,
T: Sync,
impl<T> Unpin for ArchivedOption<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for ArchivedOption<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,