mz_catalog::durable::objects

Trait DurableType

Source
pub trait DurableType: Sized {
    type Key;
    type Value;

    // Required methods
    fn into_key_value(self) -> (Self::Key, Self::Value);
    fn from_key_value(key: Self::Key, value: Self::Value) -> Self;
    fn key(&self) -> Self::Key;
}
Expand description

A trait for representing Self as a key-value pair of type (Key, Value) for the purpose of storing this value durably.

To encode a key-value pair, use DurableType::into_key_value.

To decode a key-value pair, use DurableType::from_key_value.

This trait is based on RustType, however it is meant to convert the types used in RustType to a more consumable and condensed type.

Required Associated Types§

Required Methods§

Source

fn into_key_value(self) -> (Self::Key, Self::Value)

Consume and convert Self into a (Key, Value) key-value pair.

Source

fn from_key_value(key: Self::Key, value: Self::Value) -> Self

Consume and convert a (Key, Value) key-value pair back into a Self value.

Source

fn key(&self) -> Self::Key

Produce a Key from self. This may involve cloning/copying required fields.

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.

Implementations on Foreign Types§

Source§

impl DurableType for MzAclItem

Source§

type Key = SystemPrivilegesKey

Source§

type Value = SystemPrivilegesValue

Source§

fn into_key_value(self) -> (Self::Key, Self::Value)

Source§

fn from_key_value(key: Self::Key, value: Self::Value) -> Self

Source§

fn key(&self) -> Self::Key

Implementors§

Source§

impl DurableType for AuditLog

Source§

impl DurableType for Cluster

Source§

impl DurableType for ClusterReplica

Source§

impl DurableType for Comment

Source§

impl DurableType for Config

Source§

impl DurableType for Database

Source§

impl DurableType for DefaultPrivilege

Source§

impl DurableType for IdAlloc

Source§

impl DurableType for IntrospectionSourceIndex

Source§

impl DurableType for Item

Source§

impl DurableType for NetworkPolicy

Source§

impl DurableType for Role

Source§

impl DurableType for Schema

Source§

impl DurableType for Setting

Source§

impl DurableType for SourceReferences

Source§

impl DurableType for StorageCollectionMetadata

Source§

impl DurableType for SystemConfiguration

Source§

impl DurableType for SystemObjectMapping

Source§

impl DurableType for UnfinalizedShard