pub struct Engine<E: BufferPooler + Clock + Spawner + Storage + Metrics + CryptoRng, P: Provider<Scope = Epoch>, D: Digest, A: Automaton<Context = Height, Digest = D>, Z: Reporter<Activity = Activity<P::Scheme, D>>, M: Monitor<Index = Epoch>, B: Blocker<PublicKey = <P::Scheme as Verifier>::PublicKey>, T: Strategy> { /* private fields */ }Expand description
Instance of the engine.
Implementations§
Source§impl<E: BufferPooler + Clock + Spawner + Storage + Metrics + CryptoRng, P: Provider<Scope = Epoch, Scheme: Scheme<D>>, D: Digest, A: Automaton<Context = Height, Digest = D>, Z: Reporter<Activity = Activity<P::Scheme, D>>, M: Monitor<Index = Epoch>, B: Blocker<PublicKey = <P::Scheme as Verifier>::PublicKey>, T: Strategy> Engine<E, P, D, A, Z, M, B, T>
impl<E: BufferPooler + Clock + Spawner + Storage + Metrics + CryptoRng, P: Provider<Scope = Epoch, Scheme: Scheme<D>>, D: Digest, A: Automaton<Context = Height, Digest = D>, Z: Reporter<Activity = Activity<P::Scheme, D>>, M: Monitor<Index = Epoch>, B: Blocker<PublicKey = <P::Scheme as Verifier>::PublicKey>, T: Strategy> Engine<E, P, D, A, Z, M, B, T>
Sourcepub fn new(context: E, cfg: Config<P, D, A, Z, M, B, T>) -> Self
pub fn new(context: E, cfg: Config<P, D, A, Z, M, B, T>) -> Self
Creates a new engine with the given context and configuration.
Sourcepub fn start(
self,
network: (impl Sender<PublicKey = <P::Scheme as Verifier>::PublicKey>, impl Receiver<PublicKey = <P::Scheme as Verifier>::PublicKey>),
) -> Handle<()> ⓘ
pub fn start( self, network: (impl Sender<PublicKey = <P::Scheme as Verifier>::PublicKey>, impl Receiver<PublicKey = <P::Scheme as Verifier>::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, T> !Freeze for Engine<E, P, D, A, Z, M, B, T>
impl<E, P, D, A, Z, M, B, T> !RefUnwindSafe for Engine<E, P, D, A, Z, M, B, T>
impl<E, P, D, A, Z, M, B, T> !Sync for Engine<E, P, D, A, Z, M, B, T>
impl<E, P, D, A, Z, M, B, T> !UnwindSafe for Engine<E, P, D, A, Z, M, B, T>
impl<E, P, D, A, Z, M, B, T> Send for Engine<E, P, D, A, Z, M, B, T>where
Cell<E>: Send,
Pool<'static, DigestRequest<D>>: Send,
SafeTip<<<P as Provider>::Scheme as Verifier>::PublicKey>: Send,
BTreeMap<Height, Pending<<P as Provider>::Scheme, D>>: Send,
BTreeMap<Height, Certificate<<P as Provider>::Scheme, D>>: Send,
Option<Journal<E, Activity<<P as Provider>::Scheme, D>>>: Send,
impl<E, P, D, A, Z, M, B, T> Unpin for Engine<E, P, D, A, Z, M, B, T>where
Cell<E>: Unpin,
A: Unpin,
M: Unpin,
P: Unpin,
Z: Unpin,
B: Unpin,
T: Unpin,
Pool<'static, DigestRequest<D>>: Unpin,
SafeTip<<<P as Provider>::Scheme as Verifier>::PublicKey>: Unpin,
BTreeMap<Height, Pending<<P as Provider>::Scheme, D>>: Unpin,
BTreeMap<Height, Certificate<<P as Provider>::Scheme, D>>: Unpin,
Option<Journal<E, Activity<<P as Provider>::Scheme, D>>>: Unpin,
impl<E, P, D, A, Z, M, B, T> UnsafeUnpin for Engine<E, P, D, A, Z, M, B, T>where
Cell<E>: UnsafeUnpin,
A: UnsafeUnpin,
M: UnsafeUnpin,
P: UnsafeUnpin,
Z: UnsafeUnpin,
B: UnsafeUnpin,
T: UnsafeUnpin,
Pool<'static, DigestRequest<D>>: UnsafeUnpin,
SafeTip<<<P as Provider>::Scheme as Verifier>::PublicKey>: UnsafeUnpin,
BTreeMap<Height, Pending<<P as Provider>::Scheme, D>>: UnsafeUnpin,
BTreeMap<Height, Certificate<<P as Provider>::Scheme, D>>: UnsafeUnpin,
Option<Journal<E, Activity<<P as Provider>::Scheme, D>>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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