extern crate ply_rs; use ply_rs::ply::{ Ply, DefaultElement }; use ply_rs::writer::{ Writer }; /// Demonstrates simplest use case for reading from a file. fn main() { // set up a target, could also be a file let mut buf = Vec::::new(); // crete a ply objet let mut ply = Ply::::new(); // set up a writer let w = Writer::new(); let written = w.write_ply(&mut buf, &mut ply).unwrap(); println!("{} bytes written", written); println!("buffer size: {}", buf.len()); // proof that data has been read // We can use `from_utf8` since PLY files only contain ascii characters let output = String::from_utf8(buf).unwrap(); println!("Written data:\n{}", output); }