pub struct Engine<E: Clock + Spawner + Storage + Metrics, P: Provider<Scope = Epoch>, D: Digest, A: Automaton<Context = Index, Digest = D> + Clone, Z: Reporter<Activity = Activity<P::Scheme, D>>, M: Monitor<Index = Epoch>, B: Blocker<PublicKey = <P::Scheme as Scheme>::PublicKey>> { /* private fields */ }Expand description
Instance of the engine.
Implementations§
Source§impl<E: Clock + Spawner + Storage + Metrics, P: Provider<Scope = Epoch, Scheme: Scheme<D>>, D: Digest, A: Automaton<Context = Index, Digest = D> + Clone, Z: Reporter<Activity = Activity<P::Scheme, D>>, M: Monitor<Index = Epoch>, B: Blocker<PublicKey = <P::Scheme as Scheme>::PublicKey>> Engine<E, P, D, A, Z, M, B>
impl<E: Clock + Spawner + Storage + Metrics, P: Provider<Scope = Epoch, Scheme: Scheme<D>>, D: Digest, A: Automaton<Context = Index, Digest = D> + Clone, Z: Reporter<Activity = Activity<P::Scheme, D>>, M: Monitor<Index = Epoch>, B: Blocker<PublicKey = <P::Scheme as Scheme>::PublicKey>> Engine<E, P, D, A, Z, M, B>
Sourcepub fn new(context: E, cfg: Config<P, D, A, Z, M, B>) -> Self
pub fn new(context: E, cfg: Config<P, D, A, Z, M, B>) -> Self
Creates a new engine with the given context and configuration.
Sourcepub fn start(
self,
network: (impl Sender<PublicKey = <P::Scheme as Scheme>::PublicKey>, impl Receiver<PublicKey = <P::Scheme as Scheme>::PublicKey>),
) -> Handle<()>
pub fn start( self, network: (impl Sender<PublicKey = <P::Scheme as Scheme>::PublicKey>, impl Receiver<PublicKey = <P::Scheme as Scheme>::PublicKey>), ) -> Handle<()>
Runs the engine until the context is stopped.
The engine will handle:
- Requesting and processing digests from the automaton
- Timeouts
- Refreshing the Epoch
- Rebroadcasting Acks
- Messages from the network:
- Acks from other validators
Auto Trait Implementations§
impl<E, P, D, A, Z, M, B> !Freeze for Engine<E, P, D, A, Z, M, B>
impl<E, P, D, A, Z, M, B> !RefUnwindSafe for Engine<E, P, D, A, Z, M, B>
impl<E, P, D, A, Z, M, B> Send for Engine<E, P, D, A, Z, M, B>
impl<E, P, D, A, Z, M, B> !Sync for Engine<E, P, D, A, Z, M, B>
impl<E, P, D, A, Z, M, B> Unpin for Engine<E, P, D, A, Z, M, B>where
A: Unpin,
M: Unpin,
P: Unpin,
Z: Unpin,
B: Unpin,
E: Unpin,
<<<P as Provider>::Scheme as Scheme>::Certificate as Read>::Cfg: Unpin,
<<P as Provider>::Scheme as Scheme>::Certificate: Unpin,
<<P as Provider>::Scheme as Scheme>::PublicKey: Unpin,
D: Unpin,
<<P as Provider>::Scheme as Scheme>::Signature: Unpin,
impl<E, P, D, A, Z, M, B> !UnwindSafe for Engine<E, P, D, A, Z, M, B>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more