pub enum Form {
State,
Slots,
Items,
Arguments,
Argument,
}
Expand description
How an object is created from the value it’s emitted as.
The deserializer attaches the form to the first event of an
object together with its class (see take_form).
The serializer creates objects in this form (see set_form) which
makes them read back as they were. Without a form, objects that are
maps are created from their state, lists from their items, tuples from
their arguments and other values are the argument.
The value is the state: cls.__new__(cls) and __setstate__ (or
the attributes for maps). This is how Python pickles instances of
classes (including dataclasses).
The value is the items: cls.__new__(cls) and __setitem__ for
maps, extend (or append) for sequences. This is how Python
pickles subclasses of dict and list.