pub struct Engine<E: Clock + Spawner + Storage + Metrics, C: Signer, V: Variant, D: Digest, A: Automaton<Context = Context<C::PublicKey>, Digest = D> + Clone, R: Relay<Digest = D>, Z: Reporter<Activity = Activity<C::PublicKey, V, D>>, M: Monitor<Index = Epoch>, Su: Supervisor<Index = Epoch, PublicKey = C::PublicKey>, TSu: ThresholdSupervisor<Index = Epoch, PublicKey = C::PublicKey, Identity = V::Public, Polynomial = Public<V>, Share = Share>, NetS: Sender<PublicKey = C::PublicKey>, NetR: Receiver<PublicKey = C::PublicKey>> { /* private fields */ }
Expand description
Instance of the engine.
Implementations§
Source§impl<E: Clock + Spawner + Storage + Metrics, C: Signer, V: Variant, D: Digest, A: Automaton<Context = Context<C::PublicKey>, Digest = D> + Clone, R: Relay<Digest = D>, Z: Reporter<Activity = Activity<C::PublicKey, V, D>>, M: Monitor<Index = Epoch>, Su: Supervisor<Index = Epoch, PublicKey = C::PublicKey>, TSu: ThresholdSupervisor<Index = Epoch, PublicKey = C::PublicKey, Identity = V::Public, Polynomial = Public<V>, Share = Share>, NetS: Sender<PublicKey = C::PublicKey>, NetR: Receiver<PublicKey = C::PublicKey>> Engine<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR>
impl<E: Clock + Spawner + Storage + Metrics, C: Signer, V: Variant, D: Digest, A: Automaton<Context = Context<C::PublicKey>, Digest = D> + Clone, R: Relay<Digest = D>, Z: Reporter<Activity = Activity<C::PublicKey, V, D>>, M: Monitor<Index = Epoch>, Su: Supervisor<Index = Epoch, PublicKey = C::PublicKey>, TSu: ThresholdSupervisor<Index = Epoch, PublicKey = C::PublicKey, Identity = V::Public, Polynomial = Public<V>, Share = Share>, NetS: Sender<PublicKey = C::PublicKey>, NetR: Receiver<PublicKey = C::PublicKey>> Engine<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR>
Sourcepub fn new(context: E, cfg: Config<C, V, D, A, R, Z, M, Su, TSu>) -> Self
pub fn new(context: E, cfg: Config<C, V, D, A, R, Z, M, Su, TSu>) -> Self
Creates a new engine with the given context and configuration.
Sourcepub fn start(
self,
chunk_network: (NetS, NetR),
ack_network: (NetS, NetR),
) -> Handle<()>
pub fn start( self, chunk_network: (NetS, NetR), ack_network: (NetS, NetR), ) -> 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, V, D, A, R, Z, M, Su, TSu, NetS, NetR> !Freeze for Engine<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR>
impl<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR> !RefUnwindSafe for Engine<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR>
impl<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR> Send for Engine<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR>
impl<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR> !Sync for Engine<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR>
impl<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR> Unpin for Engine<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR>
impl<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR> !UnwindSafe for Engine<E, C, V, D, A, R, Z, M, Su, TSu, NetS, NetR>
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
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