extern crate libsbxf; use libsbxf::{Handler, SBXF}; struct SBXFHandler; impl Handler for SBXFHandler { fn save_meta(&self, data: Vec) -> Result<(), ()> { println!("Meta out: {:?}", data); // Send to server, return when the server responded. Ok(()) } fn save_block(&self, data: Vec) -> Result<(), ()> { println!("Block out: {:?}", data); // Send to server, return when the server responded. Ok(()) } } fn main() { let sbxf = SBXF::new(SBXFHandler); sbxf.upload_file("Hello world!".as_bytes().to_vec()) .expect("Failed to upload file"); }