pub struct BigSmiles {
pub segments: Vec<BigSmilesSegment>,
}Expand description
A parsed BigSMILES string: a sequence of SMILES fragments and stochastic objects.
§Examples
use bigsmiles::parse;
let pe = parse("{[]CC[]}").unwrap(); // polyethylene
let pe_end = parse("CC{[$]CC[$]}CC").unwrap(); // α,ω-dimethyl polyethylene
assert_eq!(pe_end.segments.len(), 3);Fields§
§segments: Vec<BigSmilesSegment>Ordered sequence of segments making up the BigSMILES string.
Implementations§
Source§impl BigSmiles
impl BigSmiles
Sourcepub fn first_stochastic(&self) -> Option<&StochasticObject>
pub fn first_stochastic(&self) -> Option<&StochasticObject>
Returns the first stochastic object in the BigSMILES string, if any.
§Example
use bigsmiles::parse;
let bs = parse("CC{[$]CC[$]}CC").unwrap();
let stoch = bs.first_stochastic().unwrap();
assert_eq!(stoch.repeat_units.len(), 1);Sourcepub fn prefix_segments(&self) -> &[BigSmilesSegment]
pub fn prefix_segments(&self) -> &[BigSmilesSegment]
Returns the segments preceding the first stochastic object
(initiator / α-end group, e.g. the CC in CC{[$]CC[$]}).
Sourcepub fn suffix_segments(&self) -> &[BigSmilesSegment]
pub fn suffix_segments(&self) -> &[BigSmilesSegment]
Returns the segments following the last stochastic object
(terminator / ω-end group, e.g. the CC in {[$]CC[$]}CC).
Trait Implementations§
impl StructuralPartialEq for BigSmiles
Auto Trait Implementations§
impl Freeze for BigSmiles
impl RefUnwindSafe for BigSmiles
impl Send for BigSmiles
impl Sync for BigSmiles
impl Unpin for BigSmiles
impl UnsafeUnpin for BigSmiles
impl UnwindSafe for BigSmiles
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
Mutably borrows from an owned value. Read more