pub struct AmberMask {
pub residues: Vec<usize>,
pub atom_names: Vec<String>,
}Expand description
A parsed AMBER atom mask selector.
AMBER masks use a simplified selection language:
:1-10→ residues 1 through 10@CA→ atom named CA:1-10@CA→ atom CA in residues 1-10@C,CA,N→ atoms C, CA, or N
Fields§
§residues: Vec<usize>Residue selection (list of residue numbers, 1-based).
atom_names: Vec<String>Atom name selection (empty = all atoms).
Implementations§
Source§impl AmberMask
impl AmberMask
Sourcepub fn parse(mask: &str) -> Result<Self, String>
pub fn parse(mask: &str) -> Result<Self, String>
Parse an AMBER mask string.
Supported forms:
:N– single residue N:N-M– residue range N to M:N,M– residues N and M@name– single atom name@n1,n2– multiple atom names:N-M@name– combined residue + atom
Returns Err if the mask cannot be parsed.
Sourcepub fn matches_residue(&self, res_num: usize) -> bool
pub fn matches_residue(&self, res_num: usize) -> bool
Whether a residue number (1-based) is selected by this mask.
Sourcepub fn matches_atom(&self, atom_name: &str) -> bool
pub fn matches_atom(&self, atom_name: &str) -> bool
Whether an atom name is selected by this mask.
Trait Implementations§
impl StructuralPartialEq for AmberMask
Auto Trait Implementations§
impl Freeze for AmberMask
impl RefUnwindSafe for AmberMask
impl Send for AmberMask
impl Sync for AmberMask
impl Unpin for AmberMask
impl UnsafeUnpin for AmberMask
impl UnwindSafe for AmberMask
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.