Struct sdc::writer::Writer [] [src]

pub struct Writer<W: Write> {
    // some fields omitted
}

An .sdc writer.

Methods

impl Writer<BufWriter<File>>

fn from_path<P: AsRef<Path>>(path: P) -> Result<Writer<BufWriter<File>>>

Creates a new SDC file and opens it for writing.

The file will be closed when the file goes out of scope.

Examples

use sdc::writer::Writer;
let writer = Writer::from_path("/dev/null").unwrap();

impl<W: Write> Writer<W>

fn new(writer: W) -> Result<Writer<W>>

Creates a new writer, consuming the provided Write.

Examples

use std::fs::File;
use sdc::writer::Writer;
let writer = File::create("/dev/null").unwrap();
let writer = Writer::new(writer).unwrap();

fn write_point(&mut self, point: &Point) -> Result<()>

Writes a point to this SDC file.

Examples

use sdc::writer::Writer;
use sdc::point::Point;
let ref point = Point::new();
let mut file = Writer::from_path("/dev/null").unwrap();
file.write_point(point).unwrap();

Trait Implementations

Derived Implementations

impl<W: Debug + Write> Debug for Writer<W>

fn fmt(&self, __arg_0: &mut Formatter) -> Result