[][src]Struct chemfiles::Match

pub struct 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]

Get the length of the Match.

Example

let atomic_match = Match::new(&[3, 4, 5]);
assert_eq!(atomic_match.len(), 3);

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);

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 Debug for Match
[src]

Formats the value using the given formatter. Read more

impl Clone for Match
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Match
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Match
[src]

impl Index<usize> for Match
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl<'a> IntoIterator for &'a Match
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Auto Trait Implementations

impl Send for Match

impl Sync for Match

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more