Trait scrypto::prelude::radix_engine_common::Categorize
source · pub trait Categorize<X>where
X: CustomValueKind,{
// Required method
fn value_kind() -> ValueKind<X>;
}
Expand description
The Categorize
trait marks a rust type as having a fixed value kind for SBOR encoding/decoding.
Most rust types will have a fixed value kind in the SBOR model, and so can implement Categorize
,
but some (such as the SBOR Value
) do not.
Implementing Categorize
is required for being able to directly Encode
/ Decode
any
collection containing the rust type - because the value kind is lifted/deduplicated in the encoded payload.
If a type cannot implement Categorize
, as a work-around, you can put it into a collection by (eg)
wrapping it in a tuple of size 1.
Required Methods§
fn value_kind() -> ValueKind<X>
Object Safety§
This trait is not object safe.