macro_rules! impl_wire_string {
($ty:ty $(,)?) => { ... };
($ty:ty, parse = $parse:expr, format = $format:expr $(,)?) => { ... };
($ty:ty, parse = $parse:expr $(,)?) => { ... };
}Expand description
Implements the traits for a type that crosses as a String, so a malformed string is a
WireError::Parse rather than a throw from inside FromWasmAbi.
impl_wire_string!(T)parses withFromStrand formats withDisplay.impl_wire_string!(T, parse = f, format = g)takesf: FnOnce(String) -> Result<T, E>andg: FnOnce(T) -> String.impl_wire_string!(T, parse = f)implements onlyFromWasm, for a type JavaScript never receives.
Also implements wasm_bindgen’s ABI traits through the same conversion, so the type needs no
hand-written WasmDescribe / FromWasmAbi / IntoWasmAbi. from_abi cannot fail, so it
throws on a malformed string.