Expand description
An overlord consensus instance.
Implementations
sourceimpl<T, F, C, W> Overlord<T, F, C, W> where
T: Codec + Send + Sync + 'static,
F: Consensus<T> + 'static,
C: Crypto + Send + Sync + 'static,
W: Wal + 'static,
impl<T, F, C, W> Overlord<T, F, C, W> where
T: Codec + Send + Sync + 'static,
F: Consensus<T> + 'static,
C: Crypto + Send + Sync + 'static,
W: Wal + 'static,
sourcepub fn new(
address: Address,
consensus: Arc<F>,
crypto: Arc<C>,
wal: Arc<W>
) -> Self
pub fn new(
address: Address,
consensus: Arc<F>,
crypto: Arc<C>,
wal: Arc<W>
) -> Self
Create a new overlord and return an overlord instance with an unbounded receiver.
sourcepub fn get_handler(&self) -> OverlordHandler<T>
pub fn get_handler(&self) -> OverlordHandler<T>
Get the overlord handler from the overlord instance.
sourcepub async fn run(
&self,
init_height: u64,
interval: u64,
authority_list: Vec<Node>,
timer_config: Option<DurationConfig>
) -> ConsensusResult<()>
pub async fn run(
&self,
init_height: u64,
interval: u64,
authority_list: Vec<Node>,
timer_config: Option<DurationConfig>
) -> ConsensusResult<()>
Run overlord consensus process. The interval
is the height interval as millisecond.
Auto Trait Implementations
impl<T, F, C, W> !RefUnwindSafe for Overlord<T, F, C, W>
impl<T, F, C, W> Send for Overlord<T, F, C, W> where
C: Sync,
W: Send + Sync,
impl<T, F, C, W> Sync for Overlord<T, F, C, W> where
C: Sync,
W: Send + Sync,
impl<T, F, C, W> Unpin for Overlord<T, F, C, W>
impl<T, F, C, W> !UnwindSafe for Overlord<T, F, C, W>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more