Skip to main content

UpdateAvailabilityData

Trait UpdateAvailabilityData 

Source
pub trait UpdateAvailabilityData<Types: NodeType> {
    // Required method
    fn append(
        &self,
        info: BlockInfo<Types>,
    ) -> impl Send + Future<Output = Result<()>>;

    // Provided method
    fn append_payload(
        &self,
        _block: BlockQueryData<Types>,
    ) -> impl Send + Future<Output = Result<()>> { ... }
}

Required Methods§

Source

fn append( &self, info: BlockInfo<Types>, ) -> impl Send + Future<Output = Result<()>>

Append information about a new block to the database.

Provided Methods§

Source

fn append_payload( &self, _block: BlockQueryData<Types>, ) -> impl Send + Future<Output = Result<()>>

Append a payload for a block whose leaf was already decided without one.

Decide events in the new protocol may arrive before VID reconstruction has produced the block payload. When the payload eventually becomes available the data source uses this method to fill it in, notifying any pending fetchers. Implementations that don’t track blocks (e.g. metrics-only) may leave the default no-op.

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<D, U, Types> UpdateAvailabilityData<Types> for ExtensibleDataSource<D, U>
where D: UpdateAvailabilityData<Types> + Send + Sync, U: Send + Sync, Types: NodeType,

Source§

impl<Types, S, P> UpdateAvailabilityData<Types> for FetchingDataSource<Types, S, P>
where Types: NodeType, Header<Types>: QueryableHeader<Types>, Payload<Types>: QueryablePayload<Types>, S: VersionedDataSource + 'static, for<'a> S::Transaction<'a>: UpdateAvailabilityStorage<Types>, for<'a> S::ReadOnly<'a>: AvailabilityStorage<Types> + NodeStorage<Types> + PrunedHeightStorage, P: AvailabilityProvider<Types>,