Skip to main content

BranchedBuilder

Struct BranchedBuilder 

Source
pub struct BranchedBuilder { /* private fields */ }
Expand description

Builder for non-linear polymer architectures (branched, graft, macromonomer).

Unlike LinearBuilder, this builder takes two BigSMILES strings: one for the backbone and one for the branch.

Implementations§

Source§

impl BranchedBuilder

Source

pub fn new( backbone: BigSmiles, branch: BigSmiles, strategy: BuildStrategy, ) -> Self

Creates a new builder from backbone and branch BigSMILES strings plus a build strategy that governs the backbone length.

Source

pub fn comb_polymer( &self, _branch_every: usize, ) -> Result<PolymerChain, PolySimError>

Generates a comb (regularly branched) polymer.

branch_every — attach one branch every N backbone repeat units.

Source

pub fn graft_copolymer( &self, _graft_fraction: f64, ) -> Result<PolymerChain, PolySimError>

Generates a graft copolymer (random branch-point placement).

graft_fraction — fraction of backbone repeat units that carry a branch (0.0 = no grafting, 1.0 = every backbone unit is grafted).

Source

pub fn macromonomer(&self) -> Result<PolymerChain, PolySimError>

Generates a macromonomer: a single branch/side chain with a polymerisable end group.

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> 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, 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.