Datastore

Trait Datastore 

Source
pub trait Datastore {
    // Required methods
    fn source(self: Pin<&Self>) -> Pin<&Source>;
    fn slot<T>(self: Pin<&Self>) -> Pin<&Slot<T>>
       where T: Storable + 'static;
}
Expand description

Internal trait to abstract out type-erased and concrete data stores.

Required Methods§

Source

fn source(self: Pin<&Self>) -> Pin<&Source>

Returns a generational source tracking the global datastore generation.

This is used to ensure that every reader has had (or will have) a chance to read a value before a writer may overwrite it.

Source

fn slot<T>(self: Pin<&Self>) -> Pin<&Slot<T>>
where T: Storable + 'static,

Returns a reference to the slot for a specific type.

§Panics

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<S> Datastore for Pin<&S>
where S: Datastore,

Source§

fn source(self: Pin<&Self>) -> Pin<&Source>

Source§

fn slot<T>(self: Pin<&Self>) -> Pin<&Slot<T>>
where T: Storable + 'static,

Implementors§

Source§

impl<S> Datastore for Cons<Source, S>
where S: Slots,

Given a slot cons-list, combines it with a generational::Source to implement Datastore.