pub struct Engine<E: Clock + Spawner + Rng + CryptoRng + Storage + Metrics, C: Signer, S: SequencersProvider<PublicKey = C::PublicKey>, P: Provider<Scope = Epoch, Scheme: Scheme<C::PublicKey, D>>, D: Digest, A: Automaton<Context = Context<C::PublicKey>, Digest = D> + Clone, R: Relay<Digest = D>, Z: Reporter<Activity = Activity<C::PublicKey, P::Scheme, D>>, M: Monitor<Index = Epoch>> { /* private fields */ }Expand description
Instance of the engine.
Implementations§
Source§impl<E: Clock + Spawner + Rng + CryptoRng + Storage + Metrics, C: Signer, S: SequencersProvider<PublicKey = C::PublicKey>, P: Provider<Scope = Epoch, Scheme: Scheme<C::PublicKey, D, PublicKey = C::PublicKey>>, D: Digest, A: Automaton<Context = Context<C::PublicKey>, Digest = D> + Clone, R: Relay<Digest = D>, Z: Reporter<Activity = Activity<C::PublicKey, P::Scheme, D>>, M: Monitor<Index = Epoch>> Engine<E, C, S, P, D, A, R, Z, M>
impl<E: Clock + Spawner + Rng + CryptoRng + Storage + Metrics, C: Signer, S: SequencersProvider<PublicKey = C::PublicKey>, P: Provider<Scope = Epoch, Scheme: Scheme<C::PublicKey, D, PublicKey = C::PublicKey>>, D: Digest, A: Automaton<Context = Context<C::PublicKey>, Digest = D> + Clone, R: Relay<Digest = D>, Z: Reporter<Activity = Activity<C::PublicKey, P::Scheme, D>>, M: Monitor<Index = Epoch>> Engine<E, C, S, P, D, A, R, Z, M>
Sourcepub fn new(context: E, cfg: Config<C, S, P, D, A, R, Z, M>) -> Self
pub fn new(context: E, cfg: Config<C, S, P, D, A, R, Z, M>) -> Self
Creates a new engine with the given context and configuration.
Sourcepub fn start(
self,
chunk_network: (impl Sender<PublicKey = C::PublicKey>, impl Receiver<PublicKey = C::PublicKey>),
ack_network: (impl Sender<PublicKey = C::PublicKey>, impl Receiver<PublicKey = C::PublicKey>),
) -> Handle<()>
pub fn start( self, chunk_network: (impl Sender<PublicKey = C::PublicKey>, impl Receiver<PublicKey = C::PublicKey>), ack_network: (impl Sender<PublicKey = C::PublicKey>, impl Receiver<PublicKey = C::PublicKey>), ) -> Handle<()>
Runs the engine until the context is stopped.
The engine will handle:
- Requesting and processing proposals from the application
- Timeouts
- Refreshing the Epoch
- Rebroadcasting Proposals
- Messages from the network:
- Nodes
- Acks
Auto Trait Implementations§
impl<E, C, S, P, D, A, R, Z, M> !Freeze for Engine<E, C, S, P, D, A, R, Z, M>
impl<E, C, S, P, D, A, R, Z, M> !RefUnwindSafe for Engine<E, C, S, P, D, A, R, Z, M>
impl<E, C, S, P, D, A, R, Z, M> Send for Engine<E, C, S, P, D, A, R, Z, M>
impl<E, C, S, P, D, A, R, Z, M> !Sync for Engine<E, C, S, P, D, A, R, Z, M>
impl<E, C, S, P, D, A, R, Z, M> Unpin for Engine<E, C, S, P, D, A, R, Z, M>
impl<E, C, S, P, D, A, R, Z, M> !UnwindSafe for Engine<E, C, S, P, D, A, R, Z, M>
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