pub enum ParentMapping {
OffsetsOnly,
Explicit(Vec<u32>),
BlockIndexed {
block: u16,
parents: Vec<u32>,
},
}Expand description
How an atom’s residue is recovered.
Variants§
OffsetsOnly
Nothing stored; search the residue offsets.
Explicit(Vec<u32>)
One residue position per atom.
BlockIndexed
One residue position per block of atoms, refined by a bounded scan.
Implementations§
Source§impl ParentMapping
impl ParentMapping
Sourcepub const DEFAULT_BLOCK: u16 = 128
pub const DEFAULT_BLOCK: u16 = 128
Atoms per block in the default mapping.
A hundred and twenty-eight four-byte entries is one entry per five hundred and twelve bytes of atom data, and the scan it implies stays inside a few residues.
Sourcepub fn block_indexed(parents_in_order: &[u32]) -> Self
pub fn block_indexed(parents_in_order: &[u32]) -> Self
Builds the default mapping for a chunk whose atoms start at first_atom.
parent_of is the residue of each atom in chunk order.
Sourcepub fn explicit(parents_in_order: &[u32]) -> Self
pub fn explicit(parents_in_order: &[u32]) -> Self
Builds a mapping that answers in one load, for a chunk whose atoms are looked up individually often enough to justify the memory.
Sourcepub fn resolve(
&self,
local: u32,
first_atom: u32,
residues: &ResidueTable,
) -> Option<ResidueIndex>
pub fn resolve( &self, local: u32, first_atom: u32, residues: &ResidueTable, ) -> Option<ResidueIndex>
The residue of the atom at local within a chunk whose atoms begin at
first_atom in the structure’s flat order.
residues is consulted only where the mapping cannot answer alone.
Trait Implementations§
Source§impl Clone for ParentMapping
impl Clone for ParentMapping
Source§impl Debug for ParentMapping
impl Debug for ParentMapping
Source§impl Default for ParentMapping
impl Default for ParentMapping
impl Eq for ParentMapping
Source§impl PartialEq for ParentMapping
impl PartialEq for ParentMapping
impl StructuralPartialEq for ParentMapping
Auto Trait Implementations§
impl Freeze for ParentMapping
impl RefUnwindSafe for ParentMapping
impl Send for ParentMapping
impl Sync for ParentMapping
impl Unpin for ParentMapping
impl UnsafeUnpin for ParentMapping
impl UnwindSafe for ParentMapping
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> 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