Trait Storable

Source
trait Storable<Types: NodeType>: HeightIndexed + Clone {
    // Required methods
    fn name() -> &'static str;
    fn notify(
        &self,
        notifiers: &Notifiers<Types>,
    ) -> impl Send + Future<Output = ()>;
    fn store(
        self,
        storage: &mut (impl UpdateAvailabilityStorage<Types> + Send),
        leaf_only: bool,
    ) -> impl Send + Future<Output = Result<()>>;
}
Expand description

An object which can be stored in the database.

Required Methods§

Source

fn name() -> &'static str

The name of this type of object, for debugging purposes.

Source

fn notify( &self, notifiers: &Notifiers<Types>, ) -> impl Send + Future<Output = ()>

Notify anyone waiting for this object that it has become available.

Source

fn store( self, storage: &mut (impl UpdateAvailabilityStorage<Types> + Send), leaf_only: bool, ) -> impl Send + Future<Output = Result<()>>

Store the object in the local database.

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<Types> Storable<Types> for (VidCommonQueryData<Types>, Option<VidShare>)
where Types: NodeType,

Source§

fn name() -> &'static str

Source§

async fn notify(&self, notifiers: &Notifiers<Types>)

Source§

async fn store( self, storage: &mut (impl UpdateAvailabilityStorage<Types> + Send), _leaf_only: bool, ) -> Result<()>

Implementors§

Source§

impl<Types> Storable<Types> for BlockQueryData<Types>
where Types: NodeType,

Source§

impl<Types> Storable<Types> for LeafQueryData<Types>
where Types: NodeType,

Source§

impl<Types> Storable<Types> for StateCertQueryData<Types>
where Types: NodeType,

Source§

impl<Types> Storable<Types> for VidCommonQueryData<Types>
where Types: NodeType,

Source§

impl<Types: NodeType> Storable<Types> for BlockInfo<Types>