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§
Source§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>>,
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>
pub async fn spawn(self) -> SpawnResult<N, Error>
Spawns the node into context ().
Sourcepub async fn spawn_using<E>(
self,
executor: E,
) -> ExecutorSpawnResult<N, E, V, B>
pub async fn spawn_using<E>( self, executor: E, ) -> ExecutorSpawnResult<N, E, V, B>
Spawns the node in the given context.
Trait Implementations§
Source§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>>,
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>>,
Source§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.Source§fn 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, B, C> Freeze for NodeBuilder<N, F, V, B, C>where
<<<<N as Node>::Invocation as Invocation>::State as State>::Node as NodeInfo>::Id: Freeze,
V: Freeze,
<F as Finisher>::Communicator: Freeze,
B: Freeze,
C: Freeze,
F: Freeze,
<<N as Node>::Invocation as Invocation>::RoundNum: Freeze,
<<N as Node>::Invocation as Invocation>::CoordNum: Freeze,
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>
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>
impl<N, F, V, B, C> UnsafeUnpin for NodeBuilder<N, F, V, B, C>where
<<<<N as Node>::Invocation as Invocation>::State as State>::Node as NodeInfo>::Id: UnsafeUnpin,
V: UnsafeUnpin,
<F as Finisher>::Communicator: UnsafeUnpin,
B: UnsafeUnpin,
C: UnsafeUnpin,
F: UnsafeUnpin,
<<N as Node>::Invocation as Invocation>::RoundNum: UnsafeUnpin,
<<N as Node>::Invocation as Invocation>::CoordNum: UnsafeUnpin,
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§
Source§impl<B> AutofillBuilderExt for B
impl<B> AutofillBuilderExt for B
Source§type Node = <B as ExtensibleNodeBuilder>::Node
type Node = <B as ExtensibleNodeBuilder>::Node
Type of node to be decorated.
Source§type DecoratedBuilder<C: Config<Node = <B as AutofillBuilderExt>::Node> + 'static> = <B as ExtensibleNodeBuilder>::DecoratedBuilder<Autofill<<B as ExtensibleNodeBuilder>::Node, C>>
type DecoratedBuilder<C: Config<Node = <B as AutofillBuilderExt>::Node> + 'static> = <B as ExtensibleNodeBuilder>::DecoratedBuilder<Autofill<<B as ExtensibleNodeBuilder>::Node, C>>
Type of builder after
Autofill decoration is applied with config C.Source§fn fill_gaps<C>(
self,
config: C,
) -> <B as AutofillBuilderExt>::DecoratedBuilder<C>
fn fill_gaps<C>( self, config: C, ) -> <B as AutofillBuilderExt>::DecoratedBuilder<C>
Decorates the node with
Autofill using the given configuration.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<B> CatchUpBuilderExt for B
impl<B> CatchUpBuilderExt for B
type Node = <B as ExtensibleNodeBuilder>::Node
type DecoratedBuilder<C: Config<Node = <B as CatchUpBuilderExt>::Node> + 'static> = <B as ExtensibleNodeBuilder>::DecoratedBuilder<CatchUp<<B as ExtensibleNodeBuilder>::Node, C>>
fn catch_up<C>(self, config: C) -> <B as CatchUpBuilderExt>::DecoratedBuilder<C>
Source§impl<I, B> DelegateBuilderExt<I> for Bwhere
I: 'static,
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: LeadershipAwareNode<I> + 'static,
impl<I, B> DelegateBuilderExt<I> for Bwhere
I: 'static,
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: LeadershipAwareNode<I> + 'static,
Source§type Node = <B as ExtensibleNodeBuilder>::Node
type Node = <B as ExtensibleNodeBuilder>::Node
Node type to be decorated.
type DecoratedBuilder<C: Config<Node = <B as DelegateBuilderExt<I>>::Node> + 'static> = <B as ExtensibleNodeBuilder>::DecoratedBuilder<Delegate<<B as ExtensibleNodeBuilder>::Node, C, I>>
Source§fn delegate<C>(
self,
config: C,
) -> <B as DelegateBuilderExt<I>>::DecoratedBuilder<C>
fn delegate<C>( self, config: C, ) -> <B as DelegateBuilderExt<I>>::DecoratedBuilder<C>
Decorates the node with
Delegate using the given configuration.Source§impl<B> EnsureLeadershipBuilderExt for B
impl<B> EnsureLeadershipBuilderExt for B
type Node = <B as ExtensibleNodeBuilder>::Node
type DecoratedBuilder<C: Config<Node = <B as EnsureLeadershipBuilderExt>::Node> + 'static> = <B as ExtensibleNodeBuilder>::DecoratedBuilder<EnsureLeadership<<B as ExtensibleNodeBuilder>::Node, C>>
fn ensure_leadership<C>( self, config: C, ) -> <B as EnsureLeadershipBuilderExt>::DecoratedBuilder<C>
Source§impl<I, B> HeartbeatsBuilderExt<I> for Bwhere
I: 'static,
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: MaybeLeadershipAwareNode<I> + 'static,
impl<I, B> HeartbeatsBuilderExt<I> for Bwhere
I: 'static,
B: ExtensibleNodeBuilder,
<B as ExtensibleNodeBuilder>::Node: MaybeLeadershipAwareNode<I> + 'static,
Source§type Node = <B as ExtensibleNodeBuilder>::Node
type Node = <B as ExtensibleNodeBuilder>::Node
Type of node to be decorated.
Source§type DecoratedBuilder<C: Config<Node = <B as HeartbeatsBuilderExt<I>>::Node> + 'static> = <B as ExtensibleNodeBuilder>::DecoratedBuilder<Heartbeats<<B as ExtensibleNodeBuilder>::Node, C, I>>
type DecoratedBuilder<C: Config<Node = <B as HeartbeatsBuilderExt<I>>::Node> + 'static> = <B as ExtensibleNodeBuilder>::DecoratedBuilder<Heartbeats<<B as ExtensibleNodeBuilder>::Node, C, I>>
Type of builder after
Heartbeats decoration is applied with config
C.Source§fn send_heartbeats<C>(
self,
config: C,
) -> <B as HeartbeatsBuilderExt<I>>::DecoratedBuilder<C>
fn send_heartbeats<C>( self, config: C, ) -> <B as HeartbeatsBuilderExt<I>>::DecoratedBuilder<C>
Decorates the node with
Heartbeats using the given configuration.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