[−][src]Struct chemfiles::Match
A Match
is a set of atomic indexes matching a given selection. It can
mostly be used like a &[usize]
.
Implementations
impl Match
[src]
pub fn len(&self) -> usize
[src]
Get the length of the Match.
Example
let atomic_match = Match::new(&[3, 4, 5]); assert_eq!(atomic_match.len(), 3);
pub fn new(atoms: &[usize]) -> Match
[src]
Create a new match containing the atoms in the atoms
slice.
Panics
If the slice contains more than 4 elements, which is the maximal size of a match.
Example
let atomic_match = Match::new(&[3, 4, 5]); assert_eq!(atomic_match.len(), 3); assert_eq!(atomic_match[0], 3); assert_eq!(atomic_match[1], 4); assert_eq!(atomic_match[2], 5);
pub fn iter(&self) -> Iter<'_, usize>
[src]
Iterate over the atomic indexes in the match.
Example
let atomic_match = Match::new(&[3, 4, 5]); let mut iter = atomic_match.iter(); assert_eq!(iter.next(), Some(&3)); assert_eq!(iter.next(), Some(&4)); assert_eq!(iter.next(), Some(&5)); assert_eq!(iter.next(), None);
Trait Implementations
impl Clone for Match
[src]
impl Debug for Match
[src]
impl Eq for Match
[src]
impl Index<usize> for Match
[src]
type Output = usize
The returned type after indexing.
fn index(&self, i: usize) -> &Self::Output
[src]
impl<'a> IntoIterator for &'a Match
[src]
type Item = &'a usize
The type of the elements being iterated over.
type IntoIter = Iter<'a, usize>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Iter<'a, usize>
[src]
impl PartialEq<Match> for Match
[src]
impl StructuralEq for Match
[src]
impl StructuralPartialEq for Match
[src]
Auto Trait Implementations
impl RefUnwindSafe for Match
impl Send for Match
impl Sync for Match
impl Unpin for Match
impl UnwindSafe for Match
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,