pub struct InchiOutput { /* private fields */ }Expand description
The successful result of generating an InChI.
An InchiOutput is returned when generation succeeds — including the case
where the library issued a warning (Status::Warning) but still produced
an identifier. Inspect InchiOutput::status and InchiOutput::message
to distinguish a clean result from a warned one.
use inchi::{from_molfile, Status};
let methane = "\n test\n\n 1 0 0 0 0 0 0 0 0 0999 V2000\n 0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\nM END\n";
let out = from_molfile(methane, ())?;
assert_eq!(out.inchi(), "InChI=1S/CH4/h1H4");
assert_eq!(out.status(), Status::Okay);Implementations§
Source§impl InchiOutput
impl InchiOutput
Sourcepub fn inchi(&self) -> &str
pub fn inchi(&self) -> &str
The generated InChI identifier, e.g. InChI=1S/CH4/h1H4.
let out = from_molfile(m, ())?;
assert_eq!(out.inchi(), "InChI=1S/H2O/h1H2");Sourcepub fn aux_info(&self) -> &str
pub fn aux_info(&self) -> &str
The auxiliary information (AuxInfo=...) string, or empty if it was
disabled via Options::aux_info(false).
let out = from_molfile(m, ())?;
assert!(out.aux_info().starts_with("AuxInfo="));Sourcepub fn message(&self) -> &str
pub fn message(&self) -> &str
Any warning or informational message from the library (empty if none).
let out = from_molfile(m, ())?;
assert!(out.message().is_empty());Sourcepub fn log(&self) -> &str
pub fn log(&self) -> &str
The library’s human-readable log of recognized options and diagnostics.
let out = from_molfile(m, ())?;
let _ = out.log();Sourcepub fn status(&self) -> Status
pub fn status(&self) -> Status
The status class of this (successful) result: Status::Okay or
Status::Warning.
let out = from_molfile(m, ())?;
assert!(out.status().is_success());Sourcepub fn is_clean(&self) -> bool
pub fn is_clean(&self) -> bool
Returns true if generation completed without any warning.
let out = from_molfile(m, ())?;
assert!(out.is_clean());Sourcepub fn into_inchi(self) -> String
pub fn into_inchi(self) -> String
Consumes the result, returning the owned InChI string.
let inchi: String = from_molfile(m, ())?.into_inchi();
assert_eq!(inchi, "InChI=1S/CH4/h1H4");Trait Implementations§
Source§impl Clone for InchiOutput
impl Clone for InchiOutput
Source§fn clone(&self) -> InchiOutput
fn clone(&self) -> InchiOutput
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 InchiOutput
impl Debug for InchiOutput
impl Eq for InchiOutput
Source§impl PartialEq for InchiOutput
impl PartialEq for InchiOutput
Source§fn eq(&self, other: &InchiOutput) -> bool
fn eq(&self, other: &InchiOutput) -> bool
self and other values to be equal, and is used by ==.