MCPcopy Create free account
hub / github.com/base/base / new

Method new

crates/consensus/engine/src/task_queue/core.rs:56–68  ·  view source on GitHub ↗

Creates a new [`Engine`] with an empty task queue and the passed initial [`EngineState`].

(
        initial_state: EngineState,
        state_sender: Sender<EngineState>,
        task_queue_length: Sender<usize>,
    )

Source from the content-addressed store, hash-verified

54impl<EngineClient_: EngineClient> Engine<EngineClient_> {
55 /// Creates a new [`Engine`] with an empty task queue and the passed initial [`EngineState`].
56 pub fn new(
57 initial_state: EngineState,
58 state_sender: Sender<EngineState>,
59 task_queue_length: Sender<usize>,
60 ) -> Self {
61 Self {
62 state: initial_state,
63 state_sender,
64 task_queue_length,
65 tasks: BinaryHeap::default(),
66 next_task_sequence: 0,
67 }
68 }
69
70 /// Returns a reference to the inner [`EngineState`].
71 pub const fn state(&self) -> &EngineState {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected