pub trait StringIO {
    // Required methods
    fn format_as<S: AsRef<str>>(&self, fmt: S) -> Result<String>;
    fn parse_from<R: Read + Seek, S: AsRef<str>>(
        s: R,
        fmt: S
    ) -> Result<Molecule>;

    // Provided method
    fn from_str<S: AsRef<str>>(s: &str, fmt: S) -> Result<Molecule> { ... }
}

Required Methods§

source

fn format_as<S: AsRef<str>>(&self, fmt: S) -> Result<String>

Format molecule as string in specific fmt.

source

fn parse_from<R: Read + Seek, S: AsRef<str>>(s: R, fmt: S) -> Result<Molecule>

Parse molecule from string in specific fmt.

Provided Methods§

source

fn from_str<S: AsRef<str>>(s: &str, fmt: S) -> Result<Molecule>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl StringIO for Molecule

source§

fn format_as<S: AsRef<str>>(&self, fmt: S) -> Result<String>

Format molecule as string in specific molecular file format. Return error if cannot format molecule in fmt.

source§

fn parse_from<R: Read + Seek, S: AsRef<str>>(s: R, fmt: S) -> Result<Molecule>

construct molecule from string in specific molecular file format.

Implementors§