Expand description
Converting between Rust values and Xur values, driven by facet shapes.
| Rust | Xur |
|---|---|
bool | bool |
| integers | integers (range-checked) |
f32, f64 | floats |
String, &str, char | strings |
() | () |
| tuples | tuples |
Vec<T>, arrays, slices | lists |
Option<T>, Result<T, E> | the prelude’s Option, Result |
Vec<u8>, &[u8], [u8; N] | bytes |
| registered types | native objects |
| other structs and enums | records, named by a type registered for their shape |
| opaque types up to 8 bytes, like bitflags | their bits, as an integer |
Traits§
- Convert
Cx - What conversions need to know about the running program.
Functions§
- from_
value - Converts a Xur value to a Rust value of type
T, failing with a runtime error if the value doesn’t fit. - into_
value - Converts a Rust value to a Xur value, moving it into a native object if it is of a registered type.
- peek_
to_ value - Converts the value
peeklooks at, asto_valuedoes. - reflect_
error - to_
value - Converts a Rust value to a Xur value, cloning it if it is of a registered type.