pub struct SymbolId(/* private fields */);Expand description
An interned identifier.
Identifiers below the canonical count mean the same string in every structure. Above it they are meaningful only against the interner that issued them.
§Examples
use molframe_core::{Interner, SymbolId};
let mut interner = Interner::new();
let alanine = interner.intern("ALA")?;
assert!(alanine.is_canonical());
let ligand = interner.intern("MY_LIGAND")?;
assert!(!ligand.is_canonical());
assert_eq!(interner.resolve(ligand), Some("MY_LIGAND"));Implementations§
Source§impl SymbolId
impl SymbolId
Sourcepub fn is_canonical(self) -> bool
pub fn is_canonical(self) -> bool
Returns true when this identifier has the same meaning in every structure, so comparing it across structures is sound.
Runs in O(1) time and allocates no memory.
Trait Implementations§
Source§impl ColumnValue for SymbolId
impl ColumnValue for SymbolId
impl Copy for SymbolId
impl Eq for SymbolId
Source§impl Ord for SymbolId
impl Ord for SymbolId
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 PartialOrd for SymbolId
impl PartialOrd for SymbolId
impl StructuralPartialEq for SymbolId
Auto Trait Implementations§
impl Freeze for SymbolId
impl RefUnwindSafe for SymbolId
impl Send for SymbolId
impl Sync for SymbolId
impl Unpin for SymbolId
impl UnsafeUnpin for SymbolId
impl UnwindSafe for SymbolId
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