pub struct OptionalSymbol(/* private fields */);Expand description
An interned identifier that may be absent.
§Examples
use molframe_core::{Interner, OptionalSymbol};
let mut interner = Interner::new();
let present = OptionalSymbol::some(interner.intern("A")?);
assert!(present.get().is_some());
assert_eq!(OptionalSymbol::NONE.get(), None);
assert_eq!(size_of::<OptionalSymbol>(), 4);Implementations§
Trait Implementations§
Source§impl Clone for OptionalSymbol
impl Clone for OptionalSymbol
impl Copy for OptionalSymbol
Source§impl Debug for OptionalSymbol
impl Debug for OptionalSymbol
Source§impl Default for OptionalSymbol
impl Default for OptionalSymbol
impl Eq for OptionalSymbol
Source§impl From<OptionalSymbol> for Option<SymbolId>
impl From<OptionalSymbol> for Option<SymbolId>
Source§fn from(optional: OptionalSymbol) -> Self
fn from(optional: OptionalSymbol) -> Self
Converts to this type from the input type.
Source§impl Hash for OptionalSymbol
impl Hash for OptionalSymbol
Source§impl Ord for OptionalSymbol
impl Ord for OptionalSymbol
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for OptionalSymbol
impl PartialEq for OptionalSymbol
Source§impl PartialOrd for OptionalSymbol
impl PartialOrd for OptionalSymbol
impl StructuralPartialEq for OptionalSymbol
Auto Trait Implementations§
impl Freeze for OptionalSymbol
impl RefUnwindSafe for OptionalSymbol
impl Send for OptionalSymbol
impl Sync for OptionalSymbol
impl Unpin for OptionalSymbol
impl UnsafeUnpin for OptionalSymbol
impl UnwindSafe for OptionalSymbol
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more