StorageFamily

Trait StorageFamily 

Source
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§

Source

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

The string type for this storage family.

Source

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

The list type for this storage family.

Source

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§

Source§

impl StorageFamily for Owned

Source§

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

Source§

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

Source§

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

Source§

impl StorageFamily for Transient

Source§

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

Source§

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

Source§

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