[−][src]Struct chemfiles::Match
A Match
is a set of atomic indexes matching a given selection. It can
mostly be used like a &[u64]
.
Methods
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: &[u64]) -> 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<u64>
[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 PartialEq<Match> for Match
[src]
impl<'a> IntoIterator for &'a Match
[src]
type Item = &'a u64
The type of the elements being iterated over.
type IntoIter = Iter<'a, u64>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Iter<'a, u64>
[src]
impl Clone for Match
[src]
fn clone(&self) -> Match
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Match
[src]
impl Debug for Match
[src]
impl Index<usize> for Match
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,