pub struct AltId(/* private fields */);Expand description
An alternate-location label.
The blank label means “this atom belongs to every conformation” — a residue routinely mixes blank-labelled backbone atoms with labelled side-chain ones, which is exactly why picking the highest-occupancy atom one at a time can assemble a conformation that was never modelled.
A label of any length is representable, because refusing to truncate applies to labels as much as to chain identifiers.
§Examples
use molframe_core::{AltId, Interner};
let mut interner = Interner::new();
let a = AltId::labelled(interner.intern("A")?);
assert!(a.is_some_and(|label| !label.is_blank()));
assert!(AltId::BLANK.is_blank());Implementations§
Source§impl AltId
impl AltId
Sourcepub const fn labelled(symbol: SymbolId) -> Option<Self>
pub const fn labelled(symbol: SymbolId) -> Option<Self>
Creates a label from an interned string.
Identifiers emitted by crate::Interner are guaranteed to fit this
offset encoding without overflowing.
Runs in O(1) time and allocates no memory.
Sourcepub const fn is_blank(self) -> bool
pub const fn is_blank(self) -> bool
Returns true for the blank label.
Runs in O(1) time and allocates no memory.
Sourcepub const fn symbol(self) -> Option<SymbolId>
pub const fn symbol(self) -> Option<SymbolId>
The interned label, or None when blank.
Runs in O(1) time and allocates no memory.
Trait Implementations§
impl Copy for AltId
impl Eq for AltId
Source§impl Ord for AltId
impl Ord for AltId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for AltId
impl PartialOrd for AltId
impl StructuralPartialEq for AltId
Auto Trait Implementations§
impl Freeze for AltId
impl RefUnwindSafe for AltId
impl Send for AltId
impl Sync for AltId
impl Unpin for AltId
impl UnsafeUnpin for AltId
impl UnwindSafe for AltId
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
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
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> ⓘ
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> ⓘ
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