StorageFamily

Trait StorageFamily 

pub trait StorageFamily:
    Clone
    + Debug
    + Sealed {
    type String<'a>: AsRef<str> + Clone + Debug + Serialize
       where Self: 'a;
    type List<'a, T: Clone + Debug + Serialize + 'a>: AsRef<[T]> + Clone + Debug + Serialize
       where Self: 'a;
    type Value<'a>: Clone + Debug + Serialize
       where Self: 'a;
}
Expand description

A trait defining how data is stored in different contexts.

This trait allows the same protocol messages to be used with different storage strategies, see the main protocol module docs for more details on the strategies provided.

§Examples

use veecle_telemetry::protocol::base::StorageFamily;
use veecle_telemetry::protocol::transient::Transient;

// The Transient family uses references
let message: <Transient as StorageFamily>::String<'_> = "hello";

Required Associated Types§

type String<'a>: AsRef<str> + Clone + Debug + Serialize where Self: 'a

The string type for this storage family.

type List<'a, T: Clone + Debug + Serialize + 'a>: AsRef<[T]> + Clone + Debug + Serialize where Self: 'a

The list type for this storage family.

type Value<'a>: Clone + Debug + Serialize where Self: 'a

The value type for this storage family.

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§

§

impl StorageFamily for Owned

§

type String<'a> = String where Owned: 'a

§

type List<'a, T: Clone + Debug + Serialize + 'a> = Vec<T> where Owned: 'a

§

type Value<'a> = Value where Owned: 'a

§

impl StorageFamily for Transient

§

type String<'a> = &'a str where Transient: 'a

§

type List<'a, T: Clone + Debug + Serialize + 'a> = &'a [T] where Transient: 'a

§

type Value<'a> = Value<'a> where Transient: 'a