CustomExtension

Trait 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>::CustomLocalTypeKind, LocalTypeId>,
    ) -> bool;
    fn custom_type_kind_matches_non_custom_value_kind(
        schema: &SchemaV1<Self::CustomSchema>,
        custom_type_kind: &<Self::CustomSchema as CustomSchema>::CustomLocalTypeKind,
        non_custom_value_kind: ValueKind<Self::CustomValueKind>,
    ) -> bool;
}

Required Associated Constants§

Required Associated Types§

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>::CustomLocalTypeKind, 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>::CustomLocalTypeKind, 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).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§