Skip to main content

Storage

Trait Storage 

Source
pub trait Storage<TYPES: NodeType>:
    Send
    + Sync
    + Clone
    + 'static {
    // Required methods
    fn append_vid<'life0, 'life1, 'async_trait>(
        &'life0 self,
        proposal: &'life1 Proposal<TYPES, VidDisperseShare<TYPES>>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn append_da<'life0, 'life1, 'async_trait>(
        &'life0 self,
        proposal: &'life1 Proposal<TYPES, DaProposal<TYPES>>,
        vid_commit: VidCommitment,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn append_proposal_wrapper<'life0, 'life1, 'async_trait>(
        &'life0 self,
        proposal: &'life1 Proposal<TYPES, QuorumProposalWrapper<TYPES>>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn record_action<'life0, 'async_trait>(
        &'life0 self,
        view: ViewNumber,
        action: HotShotAction,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_state_cert<'life0, 'async_trait>(
        &'life0 self,
        state_cert: LightClientStateUpdateCertificateV2<TYPES>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_decided_upgrade_certificate<'life0, 'async_trait>(
        &'life0 self,
        decided_upgrade_certificate: Option<UpgradeCertificate<TYPES>>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn store_drb_result<'life0, 'async_trait>(
        &'life0 self,
        epoch: EpochNumber,
        drb_result: DrbResult,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn store_epoch_root<'life0, 'async_trait>(
        &'life0 self,
        epoch: EpochNumber,
        block_header: TYPES::BlockHeader,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn store_drb_input<'life0, 'async_trait>(
        &'life0 self,
        drb_input: DrbInput,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load_drb_input<'life0, 'async_trait>(
        &'life0 self,
        _epoch: u64,
    ) -> Pin<Box<dyn Future<Output = Result<DrbInput>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn append_da2<'life0, 'life1, 'async_trait>(
        &'life0 self,
        proposal: &'life1 Proposal<TYPES, DaProposal2<TYPES>>,
        vid_commit: VidCommitment,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn load_drb_result<'life0, 'async_trait>(
        &'life0 self,
        epoch: EpochNumber,
    ) -> Pin<Box<dyn Future<Output = Result<DrbResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Abstraction for storing a variety of consensus payload datum.

Required Methods§

Source

fn append_vid<'life0, 'life1, 'async_trait>( &'life0 self, proposal: &'life1 Proposal<TYPES, VidDisperseShare<TYPES>>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a proposal to the stored VID proposals.

Source

fn append_da<'life0, 'life1, 'async_trait>( &'life0 self, proposal: &'life1 Proposal<TYPES, DaProposal<TYPES>>, vid_commit: VidCommitment, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a proposal to the stored DA proposals.

Source

fn append_proposal_wrapper<'life0, 'life1, 'async_trait>( &'life0 self, proposal: &'life1 Proposal<TYPES, QuorumProposalWrapper<TYPES>>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a proposal we sent to the store

Source

fn record_action<'life0, 'async_trait>( &'life0 self, view: ViewNumber, action: HotShotAction, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Record a HotShotAction taken.

Source

fn update_state_cert<'life0, 'async_trait>( &'life0 self, state_cert: LightClientStateUpdateCertificateV2<TYPES>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update the light client state update certificate in storage.

Source

fn update_decided_upgrade_certificate<'life0, 'async_trait>( &'life0 self, decided_upgrade_certificate: Option<UpgradeCertificate<TYPES>>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Upgrade the current decided upgrade certificate in storage.

Source

fn store_drb_result<'life0, 'async_trait>( &'life0 self, epoch: EpochNumber, drb_result: DrbResult, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add a drb result

Source

fn store_epoch_root<'life0, 'async_trait>( &'life0 self, epoch: EpochNumber, block_header: TYPES::BlockHeader, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add an epoch block header

Source

fn store_drb_input<'life0, 'async_trait>( &'life0 self, drb_input: DrbInput, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn load_drb_input<'life0, 'async_trait>( &'life0 self, _epoch: u64, ) -> Pin<Box<dyn Future<Output = Result<DrbInput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn append_da2<'life0, 'life1, 'async_trait>( &'life0 self, proposal: &'life1 Proposal<TYPES, DaProposal2<TYPES>>, vid_commit: VidCommitment, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a proposal to the stored DA proposals.

Source

fn load_drb_result<'life0, 'async_trait>( &'life0 self, epoch: EpochNumber, ) -> Pin<Box<dyn Future<Output = Result<DrbResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§