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§

Required Associated Constants§

Required Methods§

source

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”

source

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.

Implementors§