Struct paxakos::node_builder::NodeBuilder
source · pub struct NodeBuilder<N: Node, F: Finisher<Node = N>, V = IndiscriminateVoterFor<N>, B = InMemoryBuffer<RoundNumOf<N>, CoordNumOf<N>, LogEntryOf<N>>, C = ()> { /* private fields */ }
Expand description
Node builder with all essential information set.
Implementations
sourceimpl<N, F, V, B, C> NodeBuilder<N, F, V, B, C>where
N: NodeImpl + 'static,
F: Finisher<Node = N>,
V: Voter<State = StateOf<N>, RoundNum = RoundNumOf<N>, CoordNum = CoordNumOf<N>, Abstain = AbstainOf<N>, Yea = YeaOf<N>, Nay = NayOf<N>>,
B: Buffer<RoundNum = RoundNumOf<N>, CoordNum = CoordNumOf<N>, Entry = LogEntryOf<N>>,
impl<N, F, V, B, C> NodeBuilder<N, F, V, B, C>where
N: NodeImpl + 'static,
F: Finisher<Node = N>,
V: Voter<State = StateOf<N>, RoundNum = RoundNumOf<N>, CoordNum = CoordNumOf<N>, Abstain = AbstainOf<N>, Yea = YeaOf<N>, Nay = NayOf<N>>,
B: Buffer<RoundNum = RoundNumOf<N>, CoordNum = CoordNumOf<N>, Entry = LogEntryOf<N>>,
sourcepub fn buffering_applied_entries_in<T: Buffer<RoundNum = RoundNumOf<N>, CoordNum = CoordNumOf<N>, Entry = LogEntryOf<N>>>(
self,
buffer: T
) -> NodeBuilder<N, F, V, T, C>
pub fn buffering_applied_entries_in<T: Buffer<RoundNum = RoundNumOf<N>, CoordNum = CoordNumOf<N>, Entry = LogEntryOf<N>>>(
self,
buffer: T
) -> NodeBuilder<N, F, V, T, C>
Sets the applied entry buffer.
sourcepub fn in_context<T>(self, context: T) -> NodeBuilder<N, F, V, B, T>
pub fn in_context<T>(self, context: T) -> NodeBuilder<N, F, V, B, T>
Sets the context the node will execute in.
See State::Context.
sourcepub fn traced_by<T: Into<Box<dyn Tracer<InvocationOf<N>>>>>(
self,
tracer: T
) -> Self
pub fn traced_by<T: Into<Box<dyn Tracer<InvocationOf<N>>>>>(
self,
tracer: T
) -> Self
Tracer to record events with.
sourcepub fn voting_with<T>(self, voter: T) -> NodeBuilder<N, F, T, B, C>
pub fn voting_with<T>(self, voter: T) -> NodeBuilder<N, F, T, B, C>
Sets the voting strategy to use.
sourcepub fn using(self, kit: NodeKit<InvocationOf<N>>) -> Self
pub fn using(self, kit: NodeKit<InvocationOf<N>>) -> Self
Sets the node kit to use.
sourcepub async fn spawn(self) -> SpawnResult<N, Error>where
StateOf<N>: State<Context = C> + Send,
C: Send,
pub async fn spawn(self) -> SpawnResult<N, Error>where
StateOf<N>: State<Context = C> + Send,
C: Send,
Spawns the node into context ()
.
sourcepub async fn spawn_using<E>(self, executor: E) -> ExecutorSpawnResult<N, E, V, B>where
StateOf<N>: State<Context = C>,
E: Executor<InvocationOf<N>, V, B>,
pub async fn spawn_using<E>(self, executor: E) -> ExecutorSpawnResult<N, E, V, B>where
StateOf<N>: State<Context = C>,
E: Executor<InvocationOf<N>, V, B>,
Spawns the node in the given context.
Trait Implementations
sourceimpl<N, F, V, B> ExtensibleNodeBuilder for NodeBuilder<N, F, V, B>where
N: NodeImpl + 'static,
F: Finisher<Node = N>,
V: Voter<State = StateOf<N>, RoundNum = RoundNumOf<N>, CoordNum = CoordNumOf<N>, Abstain = AbstainOf<N>, Yea = YeaOf<N>, Nay = NayOf<N>>,
B: Buffer<RoundNum = RoundNumOf<N>, CoordNum = CoordNumOf<N>, Entry = LogEntryOf<N>>,
impl<N, F, V, B> ExtensibleNodeBuilder for NodeBuilder<N, F, V, B>where
N: NodeImpl + 'static,
F: Finisher<Node = N>,
V: Voter<State = StateOf<N>, RoundNum = RoundNumOf<N>, CoordNum = CoordNumOf<N>, Abstain = AbstainOf<N>, Yea = YeaOf<N>, Nay = NayOf<N>>,
B: Buffer<RoundNum = RoundNumOf<N>, CoordNum = CoordNumOf<N>, Entry = LogEntryOf<N>>,
type Node = N
type Node = N
Node type without decoration applied.
type DecoratedBuilder<D: Decoration<Decorated = N> + 'static> = NodeBuilder<D, DecorationFinisher<D, F>, V, B, ()>
type DecoratedBuilder<D: Decoration<Decorated = N> + 'static> = NodeBuilder<D, DecorationFinisher<D, F>, V, B, ()>
Type of this builder after decoration
D
is applied.sourcefn decorated_with<D>(
self,
arguments: <D as Decoration>::Arguments
) -> Self::DecoratedBuilder<D>where
D: Decoration<Decorated = N, Invocation = InvocationOf<N>> + 'static,
fn decorated_with<D>(
self,
arguments: <D as Decoration>::Arguments
) -> Self::DecoratedBuilder<D>where
D: Decoration<Decorated = N, Invocation = InvocationOf<N>> + 'static,
Adds a decoration to wrap around the resulting node.
Auto Trait Implementations
impl<N, F, V = IndiscriminateVoter<<<N as Node>::Invocation as Invocation>::State, <<N as Node>::Invocation as Invocation>::RoundNum, <<N as Node>::Invocation as Invocation>::CoordNum, <<N as Node>::Invocation as Invocation>::Abstain, <<N as Node>::Invocation as Invocation>::Yea, <<N as Node>::Invocation as Invocation>::Nay>, B = InMemoryBuffer<<<N as Node>::Invocation as Invocation>::RoundNum, <<N as Node>::Invocation as Invocation>::CoordNum, <<<N as Node>::Invocation as Invocation>::State as State>::LogEntry>, C = ()> !RefUnwindSafe for NodeBuilder<N, F, V, B, C>
impl<N, F, V, B, C> Send for NodeBuilder<N, F, V, B, C>where
B: Send,
C: Send,
F: Send,
V: Send,
impl<N, F, V = IndiscriminateVoter<<<N as Node>::Invocation as Invocation>::State, <<N as Node>::Invocation as Invocation>::RoundNum, <<N as Node>::Invocation as Invocation>::CoordNum, <<N as Node>::Invocation as Invocation>::Abstain, <<N as Node>::Invocation as Invocation>::Yea, <<N as Node>::Invocation as Invocation>::Nay>, B = InMemoryBuffer<<<N as Node>::Invocation as Invocation>::RoundNum, <<N as Node>::Invocation as Invocation>::CoordNum, <<<N as Node>::Invocation as Invocation>::State as State>::LogEntry>, C = ()> !Sync for NodeBuilder<N, F, V, B, C>
impl<N, F, V, B, C> Unpin for NodeBuilder<N, F, V, B, C>where
B: Unpin,
C: Unpin,
F: Unpin,
V: Unpin,
<F as Finisher>::Communicator: Unpin,
impl<N, F, V = IndiscriminateVoter<<<N as Node>::Invocation as Invocation>::State, <<N as Node>::Invocation as Invocation>::RoundNum, <<N as Node>::Invocation as Invocation>::CoordNum, <<N as Node>::Invocation as Invocation>::Abstain, <<N as Node>::Invocation as Invocation>::Yea, <<N as Node>::Invocation as Invocation>::Nay>, B = InMemoryBuffer<<<N as Node>::Invocation as Invocation>::RoundNum, <<N as Node>::Invocation as Invocation>::CoordNum, <<<N as Node>::Invocation as Invocation>::State as State>::LogEntry>, C = ()> !UnwindSafe for NodeBuilder<N, F, V, B, C>
Blanket Implementations
sourceimpl<B> AutofillBuilderExt for Bwhere
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: 'static + NodeImpl,
impl<B> AutofillBuilderExt for Bwhere
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: 'static + NodeImpl,
type Node = <B as ExtensibleNodeBuilder>::Node
type Node = <B as ExtensibleNodeBuilder>::Node
Type of node to be decorated.
type DecoratedBuilder = <B as ExtensibleNodeBuilder>::DecoratedBuilder<Autofill<<B as ExtensibleNodeBuilder>::Node, C>>
type DecoratedBuilder = <B as ExtensibleNodeBuilder>::DecoratedBuilder<Autofill<<B as ExtensibleNodeBuilder>::Node, C>>
Type of builder after
Autofill
decoration is applied with config C
.sourcefn fill_gaps<C>(
self,
config: C
) -> <B as AutofillBuilderExt>::DecoratedBuilder<C>where
C: 'static + Config<Node = <B as AutofillBuilderExt>::Node>,
fn fill_gaps<C>(
self,
config: C
) -> <B as AutofillBuilderExt>::DecoratedBuilder<C>where
C: 'static + Config<Node = <B as AutofillBuilderExt>::Node>,
Decorates the node with
Autofill
using the given configuration.sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<B> CatchUpBuilderExt for Bwhere
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: 'static + NodeImpl,
impl<B> CatchUpBuilderExt for Bwhere
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: 'static + NodeImpl,
type Node = <B as ExtensibleNodeBuilder>::Node
type DecoratedBuilder = <B as ExtensibleNodeBuilder>::DecoratedBuilder<CatchUp<<B as ExtensibleNodeBuilder>::Node, C>>
fn catch_up<C>(self, config: C) -> <B as CatchUpBuilderExt>::DecoratedBuilder<C>where
C: 'static + Config<Node = <B as CatchUpBuilderExt>::Node>,
sourceimpl<I, B> DelegateBuilderExt<I> for Bwhere
I: 'static,
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: 'static + LeadershipAwareNode<I>,
impl<I, B> DelegateBuilderExt<I> for Bwhere
I: 'static,
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: 'static + LeadershipAwareNode<I>,
type Node = <B as ExtensibleNodeBuilder>::Node
type Node = <B as ExtensibleNodeBuilder>::Node
Node type to be decorated.
type DecoratedBuilder = <B as ExtensibleNodeBuilder>::DecoratedBuilder<Delegate<<B as ExtensibleNodeBuilder>::Node, C, I>>
sourcefn delegate<C>(
self,
config: C
) -> <B as DelegateBuilderExt<I>>::DecoratedBuilder<C>where
C: 'static + Config<Node = <B as DelegateBuilderExt<I>>::Node>,
fn delegate<C>(
self,
config: C
) -> <B as DelegateBuilderExt<I>>::DecoratedBuilder<C>where
C: 'static + Config<Node = <B as DelegateBuilderExt<I>>::Node>,
Decorates the node with
Delegate
using the given configuration.sourceimpl<B> EnsureLeadershipBuilderExt for Bwhere
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: 'static + NodeImpl,
impl<B> EnsureLeadershipBuilderExt for Bwhere
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: 'static + NodeImpl,
type Node = <B as ExtensibleNodeBuilder>::Node
type DecoratedBuilder = <B as ExtensibleNodeBuilder>::DecoratedBuilder<EnsureLeadership<<B as ExtensibleNodeBuilder>::Node, C>>
fn ensure_leadership<C>(
self,
config: C
) -> <B as EnsureLeadershipBuilderExt>::DecoratedBuilder<C>where
C: 'static + Config<Node = <B as EnsureLeadershipBuilderExt>::Node>,
sourceimpl<I, B> HeartbeatsBuilderExt<I> for Bwhere
I: 'static,
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: 'static + MaybeLeadershipAwareNode<I>,
impl<I, B> HeartbeatsBuilderExt<I> for Bwhere
I: 'static,
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: 'static + MaybeLeadershipAwareNode<I>,
type Node = <B as ExtensibleNodeBuilder>::Node
type Node = <B as ExtensibleNodeBuilder>::Node
Type of node to be decorated.
type DecoratedBuilder = <B as ExtensibleNodeBuilder>::DecoratedBuilder<Heartbeats<<B as ExtensibleNodeBuilder>::Node, C, I>>
type DecoratedBuilder = <B as ExtensibleNodeBuilder>::DecoratedBuilder<Heartbeats<<B as ExtensibleNodeBuilder>::Node, C, I>>
sourcefn send_heartbeats<C>(
self,
config: C
) -> <B as HeartbeatsBuilderExt<I>>::DecoratedBuilder<C>where
C: 'static + Config<Node = <B as HeartbeatsBuilderExt<I>>::Node>,
fn send_heartbeats<C>(
self,
config: C
) -> <B as HeartbeatsBuilderExt<I>>::DecoratedBuilder<C>where
C: 'static + Config<Node = <B as HeartbeatsBuilderExt<I>>::Node>,
Decorates the node with
Heartbeats
using the given configuration.