pub enum DepictSpec {
Mol(MolNode),
Group {
id: Option<String>,
align: bool,
children: Vec<Node>,
opts: Option<Opts>,
color: Option<String>,
scale: Option<f64>,
aromatic: Option<AromaticStyle>,
debug_box: Option<bool>,
debug_align: Option<bool>,
pad: Option<f64>,
},
ReactionScheme {
id: Option<String>,
children: Vec<Node>,
layout: Option<LayoutOpts>,
opts: Option<Opts>,
color: Option<String>,
scale: Option<f64>,
aromatic: Option<AromaticStyle>,
debug_box: Option<bool>,
debug_align: Option<bool>,
pad: Option<f64>,
},
Grid {
id: Option<String>,
children: Vec<DepictSpec>,
opts: Option<Opts>,
color: Option<String>,
scale: Option<f64>,
aromatic: Option<AromaticStyle>,
debug_box: Option<bool>,
debug_align: Option<bool>,
pad: Option<f64>,
},
}Expand description
Declarative document (mol, group, reaction_scheme, or grid root).
A root mol is MolNode — the same type as scheme / group children, so
annotations (region, circle, callout, atom_label, atom_number,
name, shade, …) are one schema everywhere.
Variants§
Mol(MolNode)
Group
Fields
aromatic: Option<AromaticStyle>ReactionScheme
Reaction / pathway scheme: mixed node children (mol | edge | text).
Fields
layout: Option<LayoutOpts>Scheme layout (direction, edge routing); backend maps these.
aromatic: Option<AromaticStyle>Grid
Grid root — each child is one row (mol / group / reaction_scheme / nested grid).
Fields
children: Vec<DepictSpec>Row roots (nested grids flatten in document order when walking mols).
aromatic: Option<AromaticStyle>Implementations§
Source§impl DepictSpec
impl DepictSpec
Sourcepub fn mols(&self) -> Vec<MolNode>
pub fn mols(&self) -> Vec<MolNode>
Flatten to mol nodes in document order (skips edge / text; walks grid rows).
Sourcepub fn grid_rows(&self) -> &[DepictSpec]
pub fn grid_rows(&self) -> &[DepictSpec]
Grid row roots (empty when not a grid).
Sourcepub fn edges(&self) -> Vec<&EdgeNode>
pub fn edges(&self) -> Vec<&EdgeNode>
Edge nodes in document order (includes edges inside grid rows).
Sourcepub fn texts(&self) -> Vec<&TextNode>
pub fn texts(&self) -> Vec<&TextNode>
Text nodes in document order (includes texts inside grid rows).
Sourcepub fn node_by_id(&self, id: &str) -> Option<&Node>
pub fn node_by_id(&self, id: &str) -> Option<&Node>
Look up a mol or text node by id (for label / lane refs).
pub fn align_enabled(&self) -> bool
Sourcepub fn container_opts(&self) -> Option<&Opts>
pub fn container_opts(&self) -> Option<&Opts>
Container-level opts bag (group, reaction_scheme, or grid).
Sourcepub fn group_opts(&self) -> Option<&Opts>
pub fn group_opts(&self) -> Option<&Opts>
Group-level opts bag (if this is a group).
Sourcepub fn resolve_mol_chrome(&self, i: usize) -> MolOpts
pub fn resolve_mol_chrome(&self, i: usize) -> MolOpts
Resolve cascading mol opts for child index i (0 for a mol root).
Order: each ancestor (opts bag → flat common), outer → inner, then node
opts → node local flat fields. Grid rows contribute their own layers.
Sourcepub fn resolve_all_mol_chrome(&self) -> Vec<MolOpts>
pub fn resolve_all_mol_chrome(&self) -> Vec<MolOpts>
Resolved chrome for every mol in document order (host paint / tests).
Trait Implementations§
Source§impl Clone for DepictSpec
impl Clone for DepictSpec
Source§fn clone(&self) -> DepictSpec
fn clone(&self) -> DepictSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DepictSpec
impl Debug for DepictSpec
Source§impl<'de> Deserialize<'de> for DepictSpec
impl<'de> Deserialize<'de> for DepictSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<MolNode> for DepictSpec
impl From<MolNode> for DepictSpec
Auto Trait Implementations§
impl Freeze for DepictSpec
impl RefUnwindSafe for DepictSpec
impl Send for DepictSpec
impl Sync for DepictSpec
impl Unpin for DepictSpec
impl UnsafeUnpin for DepictSpec
impl UnwindSafe for DepictSpec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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