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 WasmDescribe and, with a format, IntoWasmAbi through the same conversion,
for extern "C" imports that pass the type to JavaScript. There is no FromWasmAbi: a value
coming from JavaScript goes through FromWasm, so a malformed string is an
Err rather than a throw.