Trait scrypto::prelude::CustomExtension
source · pub trait CustomExtension: Debug + Clone + PartialEq + Eq + 'static {
type CustomValueKind: CustomValueKind;
type CustomTraversal: CustomTraversal<CustomValueKind = Self::CustomValueKind>;
type CustomSchema: CustomSchema;
const PAYLOAD_PREFIX: u8;
// Required methods
fn custom_value_kind_matches_type_kind(
schema: &SchemaV1<Self::CustomSchema>,
custom_value_kind: Self::CustomValueKind,
type_kind: &TypeKind<<Self::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>, LocalTypeId>
) -> bool;
fn custom_type_kind_matches_non_custom_value_kind(
schema: &SchemaV1<Self::CustomSchema>,
custom_type_kind: &<Self::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>,
non_custom_value_kind: ValueKind<Self::CustomValueKind>
) -> bool;
}
Required Associated Types§
type CustomValueKind: CustomValueKind
type CustomTraversal: CustomTraversal<CustomValueKind = Self::CustomValueKind>
type CustomSchema: CustomSchema
Required Associated Constants§
const PAYLOAD_PREFIX: u8
Required Methods§
sourcefn custom_value_kind_matches_type_kind(
schema: &SchemaV1<Self::CustomSchema>,
custom_value_kind: Self::CustomValueKind,
type_kind: &TypeKind<<Self::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>, LocalTypeId>
) -> bool
fn custom_value_kind_matches_type_kind( schema: &SchemaV1<Self::CustomSchema>, custom_value_kind: Self::CustomValueKind, type_kind: &TypeKind<<Self::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>, LocalTypeId> ) -> bool
Used in the typed traverser
This method is only called if the type_kind is not “Any”
sourcefn custom_type_kind_matches_non_custom_value_kind(
schema: &SchemaV1<Self::CustomSchema>,
custom_type_kind: &<Self::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>,
non_custom_value_kind: ValueKind<Self::CustomValueKind>
) -> bool
fn custom_type_kind_matches_non_custom_value_kind( schema: &SchemaV1<Self::CustomSchema>, custom_type_kind: &<Self::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>, non_custom_value_kind: ValueKind<Self::CustomValueKind> ) -> bool
Used in the typed traverser
This method is only called if custom_value_kind_matches_type_kind didn’t apply. It’s a fallback for any custom type kinds which should match against non-custom value kinds (in most cases there won’t be any such cases).
Object Safety§
This trait is not object safe.