pub struct Replica<K: KVStore> {
block_tree_camera: BlockTreeCamera<K>,
poller: Option<JoinHandle<()>>,
poller_shutdown: Sender<()>,
algorithm: Option<JoinHandle<()>>,
algorithm_shutdown: Sender<()>,
block_sync_server: Option<JoinHandle<()>>,
block_sync_server_shutdown: Sender<()>,
event_bus: Option<JoinHandle<()>>,
event_bus_shutdown: Option<Sender<()>>,
}
Expand description
A handle to the background threads of a HotStuff-rs replica. When this value is dropped, all background threads are gracefully shut down.
Fields§
§block_tree_camera: BlockTreeCamera<K>
§poller: Option<JoinHandle<()>>
§poller_shutdown: Sender<()>
§algorithm: Option<JoinHandle<()>>
§algorithm_shutdown: Sender<()>
§block_sync_server: Option<JoinHandle<()>>
§block_sync_server_shutdown: Sender<()>
§event_bus: Option<JoinHandle<()>>
§event_bus_shutdown: Option<Sender<()>>
Implementations§
source§impl<K: KVStore> Replica<K>
impl<K: KVStore> Replica<K>
sourcepub fn initialize(
kv_store: K,
initial_app_state: AppStateUpdates,
initial_validator_set_state: ValidatorSetState,
)
pub fn initialize( kv_store: K, initial_app_state: AppStateUpdates, initial_validator_set_state: ValidatorSetState, )
Initializes the replica’s block tree with the intial app state updates and validator set updates.
sourcepub fn block_tree_camera(&self) -> &BlockTreeCamera<K>
pub fn block_tree_camera(&self) -> &BlockTreeCamera<K>
Get a BlockTreeCamera
.
Trait Implementations§
Auto Trait Implementations§
impl<K> Freeze for Replica<K>where
K: Freeze,
impl<K> !RefUnwindSafe for Replica<K>
impl<K> Send for Replica<K>
impl<K> Sync for Replica<K>where
K: Sync,
impl<K> Unpin for Replica<K>where
K: Unpin,
impl<K> !UnwindSafe for Replica<K>
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