Skip to main content

decode_value

Function decode_value 

Source
pub fn decode_value(
    wire_tree: SchemaValueTree,
) -> Result<SchemaValue, DecodeError>
Expand description

Decode a value tree on a guest, consuming it so that each quota-token-handle node’s owned own<quota-token> resource can be moved out into an opaque super::GuestQuotaTokenHandle.

The tree is consumed because owned handles are affine: each must be moved out exactly once. Any node referenced more than once (or forming a cycle) is rejected with DecodeError::AliasedValueNode. Any handle that is never reached from the root is dropped (releasing the underlying resource) and the tree is rejected as malformed with DecodeError::UnconsumedQuotaTokenHandle.