Trait purr::walk::Follower[][src]

pub trait Follower {
    fn root(&mut self, root: AtomKind);
fn extend(&mut self, bond_kind: BondKind, atom_kind: AtomKind);
fn join(&mut self, bond_kind: BondKind, rnum: Rnum);
fn pop(&mut self, depth: usize); }

The actions possible when traversing a SMILES representation

Required methods

fn root(&mut self, root: AtomKind)[src]

A root atom has been found. This occurs at the first atom of every connected component. As such, every use of Follower must begin with at least one call to root. But root can also be called after the first atom has been found, as in methane hydrate (C.O).

fn extend(&mut self, bond_kind: BondKind, atom_kind: AtomKind)[src]

A bond between the current head atom and the next head atom has been found. Using this method implies the existence of a head atom, as in methanol (C-O or CO).

Panics

Panics if headless.

fn join(&mut self, bond_kind: BondKind, rnum: Rnum)[src]

A bond between the current head atom and a ring closure digit has been found. Using this method implies the existence of a head atom, as in cyclopropane (C1CC1).

Panics

Panics if headless.

fn pop(&mut self, depth: usize)[src]

Pop the stack by the indicated depth. As roots and extensions are encountered, Follower builds a working path. Branching removes one or more atoms from the head of this path, exposing a new head. The newly-exposed head will have previously been a head.

Panics

Panics given depth exceeds the length of the current path.

Loading content...

Implementors

impl Follower for Builder[src]

impl Follower for Writer[src]

Loading content...