Skip to main content

NodeBuilder

Struct 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§

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>>,

Source

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.

Source

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.

Source

pub fn traced_by<T: Into<Box<dyn Tracer<InvocationOf<N>>>>>( self, tracer: T, ) -> Self

Tracer to record events with.

Source

pub fn voting_with<T>(self, voter: T) -> NodeBuilder<N, F, T, B, C>

Sets the voting strategy to use.

Source

pub fn using(self, kit: NodeKit<InvocationOf<N>>) -> Self

Sets the node kit to use.

Source

pub async fn spawn(self) -> SpawnResult<N, Error>
where StateOf<N>: State<Context = C> + Send, C: Send,

Spawns the node into context ().

Source

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§

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>>,

Source§

type Node = N

Node type without decoration applied.
Source§

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,

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>

§

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 V: Send, B: Send, C: Send, F: 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 V: Unpin, <F as Finisher>::Communicator: Unpin, B: Unpin, C: Unpin, F: Unpin,

§

impl<N, F, V, B, C> UnsafeUnpin 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 = ()> !UnwindSafe for NodeBuilder<N, F, V, B, C>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<B> AutofillBuilderExt for B

Source§

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 of builder after Autofill decoration is applied with config C.
Source§

fn fill_gaps<C>( self, config: C, ) -> <B as AutofillBuilderExt>::DecoratedBuilder<C>
where C: Config<Node = <B as AutofillBuilderExt>::Node> + 'static,

Decorates the node with Autofill using the given configuration.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<B> CatchUpBuilderExt for B

Source§

type Node = <B as ExtensibleNodeBuilder>::Node

Source§

type DecoratedBuilder<C: Config<Node = <B as CatchUpBuilderExt>::Node> + 'static> = <B as ExtensibleNodeBuilder>::DecoratedBuilder<CatchUp<<B as ExtensibleNodeBuilder>::Node, C>>

Source§

fn catch_up<C>(self, config: C) -> <B as CatchUpBuilderExt>::DecoratedBuilder<C>
where C: Config<Node = <B as CatchUpBuilderExt>::Node> + 'static,

Source§

impl<I, B> DelegateBuilderExt<I> for B
where I: 'static, B: ExtensibleNodeBuilder, <B as ExtensibleNodeBuilder>::Node: LeadershipAwareNode<I> + 'static,

Source§

type Node = <B as ExtensibleNodeBuilder>::Node

Node type to be decorated.
Source§

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>
where C: Config<Node = <B as DelegateBuilderExt<I>>::Node> + 'static,

Decorates the node with Delegate using the given configuration.
Source§

impl<B> EnsureLeadershipBuilderExt for B

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<I, B> HeartbeatsBuilderExt<I> for B
where I: 'static, B: ExtensibleNodeBuilder, <B as ExtensibleNodeBuilder>::Node: MaybeLeadershipAwareNode<I> + 'static,

Source§

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 of builder after Heartbeats decoration is applied with config C.
Source§

fn send_heartbeats<C>( self, config: C, ) -> <B as HeartbeatsBuilderExt<I>>::DecoratedBuilder<C>
where C: Config<Node = <B as HeartbeatsBuilderExt<I>>::Node> + 'static,

Decorates the node with Heartbeats using the given configuration.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<B> MasterLeasesBuilderExt for B

Source§

type Node = <B as ExtensibleNodeBuilder>::Node

Source§

type DecoratedBuilder<C: Config<Node = <B as MasterLeasesBuilderExt>::Node> + 'static> = <B as ExtensibleNodeBuilder>::DecoratedBuilder<MasterLeases<<B as ExtensibleNodeBuilder>::Node, C>>

Source§

fn maintain_master_lease<C>( self, communicator_subscription: Subscription<<<<<<B as MasterLeasesBuilderExt>::Node as Node>::Invocation as Invocation>::State as State>::Node as NodeInfo>::Id>, voter_subscription: Subscription<<<<<<B as MasterLeasesBuilderExt>::Node as Node>::Invocation as Invocation>::State as State>::Node as NodeInfo>::Id>, config: C, ) -> <B as MasterLeasesBuilderExt>::DecoratedBuilder<C>
where C: Config<Node = <B as MasterLeasesBuilderExt>::Node> + 'static,

Source§

impl<B> TrackLeadershipBuilderExt for B

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more