Function parse_stl_from_slice

Source
pub fn parse_stl_from_slice(input: &mut &[u8]) -> ModalResult<Stl>
Expand description

Parse binary data in the form of bytes array, in to a Stl struct

ยงExample

use ebustl_parser::parser::parse_stl_from_slice;
use std::fs::File;
use std::io::Read;

let mut f = File::open("/path/to/subtitle.stl").expect("Open subtitle file");
let mut buffer = vec![];
f.read_to_end(&mut buffer).expect("Read to end");

let stl = parse_stl_from_slice(&mut buffer.as_slice()).expect("Parse stl from slice");
println!("{:?}", stl);