Struct sdc::writer::Writer
[−]
[src]
pub struct Writer<W: Write> { /* fields omitted */ }
An .sdc writer.
Methods
impl Writer<BufWriter<File>>
[src]
fn from_path<P: AsRef<Path>>(path: P) -> Result<Writer<BufWriter<File>>, Error>
Creates a new SDC file and opens it for writing.
The file will be closed when the file goes out of scope.
Examples
use std::fs::remove_file; use sdc::writer::Writer; { let writer = Writer::from_path("temp.sdc").unwrap(); } remove_file("temp.sdc").unwrap();
impl<W: Write> Writer<W>
[src]
fn new(writer: W) -> Result<Writer<W>, Error>
Creates a new writer, consuming the provided Write
.
Examples
use std::fs::File; use sdc::writer::Writer; let writer = File::create("temp.sdc").unwrap(); { let writer = Writer::new(writer).unwrap(); }
fn write_point(&mut self, point: &Point) -> Result<(), Error>
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("temp.sdc").unwrap(); file.write_point(point).unwrap(); }