use ciborium::ser::into_writer; use wasm_minimal_protocol::*; initiate_protocol!(); mod tokenize; #[wasm_func] pub fn init() -> Result, anyhow::Error> { tokenize::init()?; Ok(Vec::new()) } #[wasm_func] pub fn tokenize(text: &[u8]) -> Result, anyhow::Error> { let result = tokenize::tokenize(str::from_utf8(text)?)?; let mut out = Vec::new(); into_writer(&result, &mut out)?; Ok(out) }