pub struct ReplicaSpec<K: KVStore, A: App<K> + 'static, N: Network + 'static> {Show 31 fields
app: A,
network: N,
kv_store: K,
configuration: Configuration,
on_insert_block: Option<Box<dyn Fn(&InsertBlockEvent) + Send>>,
on_commit_block: Option<Box<dyn Fn(&CommitBlockEvent) + Send>>,
on_prune_block: Option<Box<dyn Fn(&PruneBlockEvent) + Send>>,
on_update_highest_pc: Option<Box<dyn Fn(&UpdateHighestPCEvent) + Send>>,
on_update_locked_pc: Option<Box<dyn Fn(&UpdateLockedPCEvent) + Send>>,
on_update_highest_tc: Option<Box<dyn Fn(&UpdateHighestTCEvent) + Send>>,
on_update_validator_set: Option<Box<dyn Fn(&UpdateValidatorSetEvent) + Send>>,
on_propose: Option<Box<dyn Fn(&ProposeEvent) + Send>>,
on_nudge: Option<Box<dyn Fn(&NudgeEvent) + Send>>,
on_phase_vote: Option<Box<dyn Fn(&PhaseVoteEvent) + Send>>,
on_new_view: Option<Box<dyn Fn(&NewViewEvent) + Send>>,
on_timeout_vote: Option<Box<dyn Fn(&TimeoutVoteEvent) + Send>>,
on_advance_view: Option<Box<dyn Fn(&AdvanceViewEvent) + Send>>,
on_receive_proposal: Option<Box<dyn Fn(&ReceiveProposalEvent) + Send>>,
on_receive_nudge: Option<Box<dyn Fn(&ReceiveNudgeEvent) + Send>>,
on_receive_phase_vote: Option<Box<dyn Fn(&ReceivePhaseVoteEvent) + Send>>,
on_receive_new_view: Option<Box<dyn Fn(&ReceiveNewViewEvent) + Send>>,
on_receive_timeout_vote: Option<Box<dyn Fn(&ReceiveTimeoutVoteEvent) + Send>>,
on_receive_advance_view: Option<Box<dyn Fn(&ReceiveAdvanceViewEvent) + Send>>,
on_start_view: Option<Box<dyn Fn(&StartViewEvent) + Send>>,
on_view_timeout: Option<Box<dyn Fn(&ViewTimeoutEvent) + Send>>,
on_collect_pc: Option<Box<dyn Fn(&CollectPCEvent) + Send>>,
on_collect_tc: Option<Box<dyn Fn(&CollectTCEvent) + Send>>,
on_start_sync: Option<Box<dyn Fn(&StartSyncEvent) + Send>>,
on_end_sync: Option<Box<dyn Fn(&EndSyncEvent) + Send>>,
on_receive_sync_request: Option<Box<dyn Fn(&ReceiveSyncRequestEvent) + Send>>,
on_send_sync_response: Option<Box<dyn Fn(&SendSyncResponseEvent) + Send>>,
}Expand description
Stores all necessary parameters and trait implementations required to run the Replica.
Fields§
§app: A§network: N§kv_store: K§configuration: Configuration§on_insert_block: Option<Box<dyn Fn(&InsertBlockEvent) + Send>>§on_commit_block: Option<Box<dyn Fn(&CommitBlockEvent) + Send>>§on_prune_block: Option<Box<dyn Fn(&PruneBlockEvent) + Send>>§on_update_highest_pc: Option<Box<dyn Fn(&UpdateHighestPCEvent) + Send>>§on_update_locked_pc: Option<Box<dyn Fn(&UpdateLockedPCEvent) + Send>>§on_update_highest_tc: Option<Box<dyn Fn(&UpdateHighestTCEvent) + Send>>§on_update_validator_set: Option<Box<dyn Fn(&UpdateValidatorSetEvent) + Send>>§on_propose: Option<Box<dyn Fn(&ProposeEvent) + Send>>§on_nudge: Option<Box<dyn Fn(&NudgeEvent) + Send>>§on_phase_vote: Option<Box<dyn Fn(&PhaseVoteEvent) + Send>>§on_new_view: Option<Box<dyn Fn(&NewViewEvent) + Send>>§on_timeout_vote: Option<Box<dyn Fn(&TimeoutVoteEvent) + Send>>§on_advance_view: Option<Box<dyn Fn(&AdvanceViewEvent) + Send>>§on_receive_proposal: Option<Box<dyn Fn(&ReceiveProposalEvent) + Send>>§on_receive_nudge: Option<Box<dyn Fn(&ReceiveNudgeEvent) + Send>>§on_receive_phase_vote: Option<Box<dyn Fn(&ReceivePhaseVoteEvent) + Send>>§on_receive_new_view: Option<Box<dyn Fn(&ReceiveNewViewEvent) + Send>>§on_receive_timeout_vote: Option<Box<dyn Fn(&ReceiveTimeoutVoteEvent) + Send>>§on_receive_advance_view: Option<Box<dyn Fn(&ReceiveAdvanceViewEvent) + Send>>§on_start_view: Option<Box<dyn Fn(&StartViewEvent) + Send>>§on_view_timeout: Option<Box<dyn Fn(&ViewTimeoutEvent) + Send>>§on_collect_pc: Option<Box<dyn Fn(&CollectPCEvent) + Send>>§on_collect_tc: Option<Box<dyn Fn(&CollectTCEvent) + Send>>§on_start_sync: Option<Box<dyn Fn(&StartSyncEvent) + Send>>§on_end_sync: Option<Box<dyn Fn(&EndSyncEvent) + Send>>§on_receive_sync_request: Option<Box<dyn Fn(&ReceiveSyncRequestEvent) + Send>>§on_send_sync_response: Option<Box<dyn Fn(&SendSyncResponseEvent) + Send>>Implementations§
source§impl<K: KVStore, A: App<K> + 'static, N: Network + 'static> ReplicaSpec<K, A, N>
impl<K: KVStore, A: App<K> + 'static, N: Network + 'static> ReplicaSpec<K, A, N>
sourcepub fn builder() -> ReplicaSpecBuilder<K, A, N, ((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ReplicaSpecBuilder<K, A, N, ((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building a ReplicaSpec. On the builder call the following methods to construct a valid ReplicaSpec.
Required:
.app(...).network(...).kv_store(...).configuration(...)
Optional:
.on_insert_block(...).on_commit_block(...).on_prune_block(...).on_update_highest_pc(...).on_update_locked_pc(...).on_update_locked_tc(...).on_update_validator_set(...).on_propose(...).on_nudge(...).on_phase_vote(...).on_new_view(...).on_timeout_vote(...).on_advance_view(...).on_receive_proposal(...).on_receive_nudge(...).on_receive_phase_vote(...).on_receive_new_view(...).on_receive_timeout_vote(...).on_receive_advance_view(...).on_start_view(...).on_view_timeout(...).on_collect_pc(...).on_collect_tc(...).on_start_sync(...).on_end_sync(...).on_receive_sync_request(...).on_receive_sync_response(...)
Auto Trait Implementations§
impl<K, A, N> Freeze for ReplicaSpec<K, A, N>
impl<K, A, N> !RefUnwindSafe for ReplicaSpec<K, A, N>
impl<K, A, N> Send for ReplicaSpec<K, A, N>
impl<K, A, N> !Sync for ReplicaSpec<K, A, N>
impl<K, A, N> Unpin for ReplicaSpec<K, A, N>
impl<K, A, N> !UnwindSafe for ReplicaSpec<K, A, N>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more