StringIO

Trait StringIO 

Source
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>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§