pub trait Storage<TYPES: NodeType>:
Send
+ Sync
+ Clone
+ 'static {
Show 20 methods
// Required methods
fn append_vid<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, ADVZDisperseShare<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn append_vid2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, VidDisperseShare2<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<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn append_proposal2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal2<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: TYPES::View,
epoch: Option<TYPES::Epoch>,
action: HotShotAction,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_high_qc<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate<TYPES>,
) -> 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: LightClientStateUpdateCertificate<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: TYPES::Epoch,
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: TYPES::Epoch,
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_vid_general<'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_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 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 update_high_qc2<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn update_high_qc2_and_state_cert<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate2<TYPES>,
state_cert: LightClientStateUpdateCertificate<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn update_next_epoch_high_qc2<'life0, 'async_trait>(
&'life0 self,
_next_epoch_high_qc: NextEpochQuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn migrate_consensus<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Expand description
Abstraction for storing a variety of consensus payload datum.
Required Methods§
Sourcefn append_vid<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, ADVZDisperseShare<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_vid<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, ADVZDisperseShare<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.
Sourcefn append_vid2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, VidDisperseShare2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_vid2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, VidDisperseShare2<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. TODO(Chengyu): fix this
Sourcefn 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_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.
Sourcefn append_proposal<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_proposal<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal<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
Sourcefn append_proposal2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_proposal2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal2<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
Sourcefn record_action<'life0, 'async_trait>(
&'life0 self,
view: TYPES::View,
epoch: Option<TYPES::Epoch>,
action: HotShotAction,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn record_action<'life0, 'async_trait>(
&'life0 self,
view: TYPES::View,
epoch: Option<TYPES::Epoch>,
action: HotShotAction,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Record a HotShotAction taken.
Sourcefn update_high_qc<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_high_qc<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the current high QC in storage.
Sourcefn update_state_cert<'life0, 'async_trait>(
&'life0 self,
state_cert: LightClientStateUpdateCertificate<TYPES>,
) -> 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: LightClientStateUpdateCertificate<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.
Sourcefn 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 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.
Sourcefn store_drb_result<'life0, 'async_trait>(
&'life0 self,
epoch: TYPES::Epoch,
drb_result: DrbResult,
) -> 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: TYPES::Epoch,
drb_result: DrbResult,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add a drb result
Sourcefn store_epoch_root<'life0, 'async_trait>(
&'life0 self,
epoch: TYPES::Epoch,
block_header: TYPES::BlockHeader,
) -> 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: TYPES::Epoch,
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
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_vid_general<'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,
Sourcefn 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 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.
Sourcefn 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 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
Sourcefn update_high_qc2<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_high_qc2<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the current high QC in storage.
fn update_high_qc2_and_state_cert<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate2<TYPES>,
state_cert: LightClientStateUpdateCertificate<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn update_next_epoch_high_qc2<'life0, 'async_trait>(
&'life0 self,
_next_epoch_high_qc: NextEpochQuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_next_epoch_high_qc2<'life0, 'async_trait>(
&'life0 self,
_next_epoch_high_qc: NextEpochQuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the current high QC in storage.
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.