Expand description
§SwimOS serialization
This crate contains the Form
trait that describes how a type can be transformed to and from
the SwimOS serialization model (described in swimos_model
). This trait is implemented for most
common primitive types and common standard library collections such as Vec
and
std::collections::HashMap
.
A derivation macro is provided that can automatically generate implementations for straightforward
struct and enum types. For instructions on how to use this, see the Form
trait or the SwimOS
documentation.
Modules§
- read
- Contains the
StructuralReadable
trait that defines the functionality to deserialize into the SwimOS model. - write
- Contains the
StructuralWritable
trait that defines the functionality to serialize a type that supports the SwimOS model.
Traits§
- Form
- A
Form
transforms between a Rust object and a structurally typedValue
. Swim forms provide a derive macro to generate an implementation ofForm
for a structure providing all members implementForm
. Forms are supported by structures and enumerations in: New Type, tuple, structure, and unit forms. Unions are not supported. - Tag
- A tag for a field in a form. When deriving the
Form
trait, a field that is annotated with#[form(tag)]
will be converted into a string and replace the original structure’s name.