Skip to main content

CustomDataType

Trait CustomDataType 

Source
pub trait CustomDataType: DataType {
    const TYPE_TAG: &'static str;
}
Expand description

A trait for user-defined custom data types.

Custom types are stored as type-erased CustomValue inside Value::Custom. The TYPE_TAG constant uniquely identifies the type and must be stable across versions.

§Ordering contract

For custom types used with range filters (Gt, Lt, Ge, Le) or ORDER BY, the Encode output must be order-preserving: if a < b, then a.encode() < b.encode() lexicographically. Equality filters (Eq, Ne, In) only require canonical encoding.

Required Associated Constants§

Source

const TYPE_TAG: &'static str

Unique string identifier for this type (e.g., "principal", "role").

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§