molcrafts-molrs 0.7.0

Molecular simulation toolkit: core data structures, IO, trajectory analysis, force fields, SMILES, and 3D conformer generation (feature-gated modules)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::io::Result;
use std::io::Write;

/// Generic writer for data destinations.
pub trait Writer {
    /// Underlying writer type.
    type W: Write;
    /// The frame type consumed by this writer.
    type FrameLike;
    /// Construct a new writer from the underlying writer.
    fn new(writer: Self::W) -> Self;
}

/// A writer that can write one logical frame at a time.
pub trait FrameWriter: Writer {
    /// Write a single frame to the stream.
    fn write_frame(&mut self, frame: &Self::FrameLike) -> Result<()>;
}