pub struct Molecule { /* private fields */ }
Expand description
A molecule is a simple, loopless graph where nodes are elements and edges are bonds.
Assembly theory literature ignores hydrogen atoms by default. Molecules can hydrogen atoms inserted into them, but by default are constructed without hydrogen atoms or bonds to hydrogen atoms.
Implementations§
Source§impl Molecule
impl Molecule
Sourcepub fn join(
&self,
other: &Molecule,
on: impl IntoIterator<Item = (NodeIndex<u32>, NodeIndex<u32>)>,
) -> Option<Molecule>
pub fn join( &self, other: &Molecule, on: impl IntoIterator<Item = (NodeIndex<u32>, NodeIndex<u32>)>, ) -> Option<Molecule>
Join self with other on on
Sourcepub fn is_isomorphic_to(&self, other: &Molecule) -> bool
pub fn is_isomorphic_to(&self, other: &Molecule) -> bool
Return true
if self is isomorphic to other
Sourcepub fn is_subgraph_of(&self, other: &Molecule) -> bool
pub fn is_subgraph_of(&self, other: &Molecule) -> bool
Return true
if self is a subgraph of other
Sourcepub fn enumerate_subgraphs(
&self,
) -> impl Iterator<Item = BTreeSet<NodeIndex<u32>>>
pub fn enumerate_subgraphs( &self, ) -> impl Iterator<Item = BTreeSet<NodeIndex<u32>>>
Return set of all subgraphs of self as an iterable data structure
Sourcepub fn is_malformed(&self) -> bool
pub fn is_malformed(&self) -> bool
Return true
if self is not formed in a valid way
In particular, a molecule is considered to be malformed if it contains multiple edges between the same source and destinations, or if there are edges from a source to itself
Sourcepub fn matches(&self) -> impl Iterator<Item = (BitSet, BitSet)>
pub fn matches(&self) -> impl Iterator<Item = (BitSet, BitSet)>
Return an iterator of bitsets from self containing all duplicate and non-overlapping pairs of isomorphic subgraphs
Sourcepub fn partitions(
&self,
) -> Option<impl Iterator<Item = (Molecule, Molecule)> + '_>
pub fn partitions( &self, ) -> Option<impl Iterator<Item = (Molecule, Molecule)> + '_>
Returns all ways to partition self as an iterable data structure of molecule pairs
Sourcepub fn single_bond() -> Self
pub fn single_bond() -> Self
Returns isolated single bond as a molecule.
Sourcepub fn double_bond() -> Self
pub fn double_bond() -> Self
Returns isolated double bond as a molecule.
Sourcepub fn is_basic_unit(&self) -> bool
pub fn is_basic_unit(&self) -> bool
Return true if and only if self is a single or double bond
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Molecule
impl RefUnwindSafe for Molecule
impl Send for Molecule
impl Sync for Molecule
impl Unpin for Molecule
impl UnwindSafe for Molecule
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more