pub enum DeserStrategy {
Show 19 variants
ContainerProxy,
FieldProxy,
Pointer {
pointee_node: NodeId,
},
OpaquePointer,
Opaque,
TransparentConvert {
inner_node: NodeId,
},
Scalar {
scalar_type: Option<ScalarType>,
is_from_str: bool,
},
Struct,
Tuple {
field_count: usize,
is_single_field_transparent: bool,
},
Enum,
Option {
some_node: NodeId,
},
Result {
ok_node: NodeId,
err_node: NodeId,
},
List {
item_node: NodeId,
is_byte_vec: bool,
},
Map {
key_node: NodeId,
value_node: NodeId,
},
Set {
item_node: NodeId,
},
Array {
len: usize,
item_node: NodeId,
},
DynamicValue,
MetadataContainer,
BackRef {
target_type_id: ConstTypeId,
},
}Expand description
Precomputed deserialization strategy with all data needed to execute it.
This is denormalized: we store node indices, proxy defs, etc. directly so the deserializer can follow the plan without chasing pointers through Shape/vtable.
Variants§
ContainerProxy
Container-level proxy: the type itself has #[facet(proxy = X)] or format-specific proxies.
The actual proxy definition and node are looked up at runtime via:
shape.effective_proxy(format_namespace)for the ProxyDefnode.proxies.node_for(format_namespace)for the TypePlan node
FieldProxy
Field-level proxy: the field has #[facet(proxy = X)] but the type doesn’t.
The actual proxy definition and node are looked up at runtime via:
field.effective_proxy(format_namespace)for the ProxyDefnode.proxies.node_for(format_namespace)for the TypePlan node (from parent’s FieldPlan)
Pointer
Smart pointer (Box, Arc, Rc) with known pointee type
OpaquePointer
Opaque smart pointer (#[facet(opaque)]) - cannot be deserialized, only set wholesale
Opaque
Opaque type (Opaque<T>) - cannot be deserialized, only set wholesale via proxy
TransparentConvert
Transparent wrapper with try_from (like NonZero)
Scalar
Scalar with FromStr
Fields
scalar_type: Option<ScalarType>Precomputed scalar type for fast hint dispatch. None for opaque scalars that need parser-specific handling.
Struct
Named struct
Tuple
Tuple or tuple struct
Fields
Enum
Enum
Option
Option<T>
Result
Result<T, E>
List
List (Vec, VecDeque, etc.)
Fields
Map
Map (HashMap, BTreeMap, etc.)
Set
Set (HashSet, BTreeSet, etc.)
Array
Fixed-size array [T; N]
DynamicValue
DynamicValue (like facet_value::Value)
MetadataContainer
Metadata container (like Spanned<T>, Documented<T>)
These require special field-by-field handling for metadata population
BackRef
BackRef to recursive type - resolved via TypePlan::resolve_backref()
Fields
target_type_id: ConstTypeIdThe TypeId of the target node