Struct Molecule

Source
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

Source

pub fn join( &self, other: &Molecule, on: impl IntoIterator<Item = (NodeIndex<u32>, NodeIndex<u32>)>, ) -> Option<Molecule>

Join self with other on on

Source

pub fn is_isomorphic_to(&self, other: &Molecule) -> bool

Return true if self is isomorphic to other

Source

pub fn is_subgraph_of(&self, other: &Molecule) -> bool

Return true if self is a subgraph of other

Source

pub fn enumerate_subgraphs( &self, ) -> impl Iterator<Item = BTreeSet<NodeIndex<u32>>>

Return set of all subgraphs of self as an iterable data structure

Source

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

Source

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

Source

pub fn partitions( &self, ) -> Option<impl Iterator<Item = (Molecule, Molecule)> + '_>

Returns all ways to partition self as an iterable data structure of molecule pairs

Source

pub fn single_bond() -> Self

Returns isolated single bond as a molecule.

Source

pub fn double_bond() -> Self

Returns isolated double bond as a molecule.

Source

pub fn is_basic_unit(&self) -> bool

Return true if and only if self is a single or double bond

Source

pub fn info(&self) -> String

Pretty-printable string representation of self

Trait Implementations§

Source§

impl Clone for Molecule

Source§

fn clone(&self) -> Molecule

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Molecule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,