Skip to main content

WriteStore

Trait WriteStore 

Source
pub trait WriteStore: ReadStore {
Show 14 methods // Required methods fn try_insert_checkpoint( &self, checkpoint: &VerifiedCheckpoint, ) -> Result<()>; fn try_update_highest_verified_checkpoint( &self, checkpoint: &VerifiedCheckpoint, ) -> Result<()>; fn try_update_highest_synced_checkpoint( &self, checkpoint: &VerifiedCheckpoint, ) -> Result<()>; fn try_insert_checkpoint_contents( &self, checkpoint: &VerifiedCheckpoint, contents: VerifiedCheckpointContents, ) -> Result<()>; fn try_insert_committee(&self, new_committee: Committee) -> Result<()>; fn try_get_highest_executed_checkpoint_seq_number( &self, ) -> Result<Option<CheckpointSequenceNumber>>; // Provided methods fn insert_checkpoint(&self, checkpoint: &VerifiedCheckpoint) { ... } fn update_highest_verified_checkpoint( &self, checkpoint: &VerifiedCheckpoint, ) { ... } fn update_highest_synced_checkpoint(&self, checkpoint: &VerifiedCheckpoint) { ... } fn insert_checkpoint_contents( &self, checkpoint: &VerifiedCheckpoint, contents: VerifiedCheckpointContents, ) { ... } fn insert_committee(&self, new_committee: Committee) { ... } fn get_highest_executed_checkpoint_seq_number( &self, ) -> Option<CheckpointSequenceNumber> { ... } fn wait_for_executed_checkpoint( &self, _sequence_number: CheckpointSequenceNumber, ) -> impl Future<Output = ()> + Send { ... } fn try_insert_synced_checkpoints( &self, checkpoints: Vec<(VerifiedCheckpoint, VerifiedCheckpointContents)>, ) -> Result<()> { ... }
}

Required Methods§

Source

fn try_insert_checkpoint(&self, checkpoint: &VerifiedCheckpoint) -> Result<()>

Source

fn try_update_highest_verified_checkpoint( &self, checkpoint: &VerifiedCheckpoint, ) -> Result<()>

Source

fn try_update_highest_synced_checkpoint( &self, checkpoint: &VerifiedCheckpoint, ) -> Result<()>

Source

fn try_insert_checkpoint_contents( &self, checkpoint: &VerifiedCheckpoint, contents: VerifiedCheckpointContents, ) -> Result<()>

Source

fn try_insert_committee(&self, new_committee: Committee) -> Result<()>

Source

fn try_get_highest_executed_checkpoint_seq_number( &self, ) -> Result<Option<CheckpointSequenceNumber>>

The highest checkpoint whose transactions have been executed, or None when no checkpoint has been executed yet. State sync counts how far it may run ahead of execution from checkpoint 0 while this is None, so a store that never advances it holds sync at that distance.

Provided Methods§

Source

fn insert_checkpoint(&self, checkpoint: &VerifiedCheckpoint)

Non-fallible version of try_insert_checkpoint.

Source

fn update_highest_verified_checkpoint(&self, checkpoint: &VerifiedCheckpoint)

Non-fallible version of try_update_highest_verified_checkpoint.

Source

fn update_highest_synced_checkpoint(&self, checkpoint: &VerifiedCheckpoint)

Non-fallible version of try_update_highest_synced_checkpoint.

Source

fn insert_checkpoint_contents( &self, checkpoint: &VerifiedCheckpoint, contents: VerifiedCheckpointContents, )

Non-fallible version of try_insert_checkpoint_contents.

Source

fn insert_committee(&self, new_committee: Committee)

Non-fallible version of try_insert_committee.

Source

fn get_highest_executed_checkpoint_seq_number( &self, ) -> Option<CheckpointSequenceNumber>

Non-fallible version of try_get_highest_executed_checkpoint_seq_number.

Source

fn wait_for_executed_checkpoint( &self, _sequence_number: CheckpointSequenceNumber, ) -> impl Future<Output = ()> + Send

Resolves once the store’s executed watermark has reached the given sequence number. The default resolves right away, so a store that executes checkpoints must override it or its callers will not wait for execution at all.

Source

fn try_insert_synced_checkpoints( &self, checkpoints: Vec<(VerifiedCheckpoint, VerifiedCheckpointContents)>, ) -> Result<()>

Inserts a consecutive run of verified checkpoints with their full contents and advances the verified and synced watermarks past the last one.

The default implementation inserts the checkpoints one at a time; implementations can override it to batch the writes.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: WriteStore + ?Sized> WriteStore for &T

Source§

impl<T: WriteStore + ?Sized> WriteStore for Arc<T>

Source§

impl<T: WriteStore + ?Sized> WriteStore for Box<T>

Implementors§