Skip to main content

Delegate

Struct Delegate 

Source
pub struct Delegate<N, C, I = ()>
where N: LeadershipAwareNode<I> + 'static, C: Config<Node = N>,
{ /* private fields */ }
Expand description

Delegate decoration.

Trait Implementations§

Source§

impl<N, C, I> Decoration for Delegate<N, C, I>
where N: NodeImpl + LeadershipAwareNode<I> + 'static, C: Config<Node = N> + 'static,

Source§

type Arguments = C

Arguments this decoration requires. Read more
Source§

type Decorated = N

Type of the decorated node.
Source§

fn wrap( decorated: Self::Decorated, arguments: Self::Arguments, ) -> Result<Self, Box<dyn Error + Send + Sync + 'static>>

Wraps this decoration around the given node, using the given arguments.
Source§

fn peek_into(decorated: &Self) -> &Self::Decorated

Returns a reference to the decorated node.
Source§

fn unwrap(decorated: Self) -> Self::Decorated

Unwraps this decoration.
Source§

impl<N, C, I> Node for Delegate<N, C, I>
where N: LeadershipAwareNode<I> + NodeImpl + 'static, C: Config<Node = N> + 'static,

Source§

type Invocation = <N as Node>::Invocation

Parametrization of the paxakos algorithm.
Source§

type Shutdown = <N as Node>::Shutdown

Type that will perform graceful shutdown if requsted.
Source§

fn id(&self) -> NodeIdOf<Self>

This node’s identifier.
Source§

fn status(&self) -> NodeStatus

Node’s current status.
Source§

fn participation(&self) -> Participation<RoundNumOf<Self>>

Node’s current mode of participation.
Source§

fn poll_events(&mut self, cx: &mut Context<'_>) -> Poll<EventFor<Self>>

Polls the node’s event stream. Read more
Source§

fn handle(&self) -> HandleFor<Self>

Returns a handle for this node. Read more
Source§

fn prepare_snapshot(&self) -> BoxFuture<'static, SnapshotFor<Self>>

Requests that snapshot of the node’s current state be taken.
Source§

fn affirm_snapshot( &self, snapshot: SnapshotFor<Self>, ) -> BoxFuture<'static, Result<(), AffirmSnapshotError>>

Affirms that the given snapshot was written to persistent storage. Read more
Source§

fn install_snapshot( &self, snapshot: SnapshotFor<Self>, ) -> BoxFuture<'static, Result<(), InstallSnapshotError>>

Requests that the given snapshot be installed. Read more
Source§

fn read_stale<F, T>(&self, f: F) -> BoxFuture<'_, Result<T, Disoriented>>
where F: FnOnce(&StateOf<Self>) -> T + Send + 'static, T: Send + 'static,

Reads the node’s current state. Read more
Source§

fn read_stale_infallibly<F, T>(&self, f: F) -> BoxFuture<'_, T>
where F: FnOnce(Option<&StateOf<Self>>) -> T + Send + 'static, T: Send + 'static,

Reads the node’s current state. Read more
Source§

fn read_stale_scoped<'read, F, T>( &self, f: F, ) -> BoxFuture<'read, Result<T, Disoriented>>
where F: FnOnce(&StateOf<Self>) -> T + Send + 'read, T: Send + 'static,

Reads the node’s current state. Read more
Source§

fn read_stale_scoped_infallibly<'read, F, T>(&self, f: F) -> BoxFuture<'read, T>
where F: FnOnce(Option<&StateOf<Self>>) -> T + Send + 'read, T: Send + 'static,

Reads the node’s current state. Read more
Source§

fn append<A, P, R>( &mut self, applicable: A, args: P, ) -> BoxFuture<'static, AppendResultFor<Self, A, R>>
where A: ApplicableTo<StateOf<Self>> + 'static, P: Into<AppendArgs<Self::Invocation, R>>, R: RetryPolicy<Invocation = Self::Invocation>, R::StaticError: From<ShutDownOr<R::Error>>,

Appends applicable to the shared log.
Source§

fn shut_down(self) -> Self::Shutdown

Begins a graceful shutdown of this node.
Source§

fn next_event(&mut self) -> NextEvent<'_, Self>

Returns a future that polls this node for events until the next one is returned.
Source§

fn events(&mut self) -> Events<'_, Self>

Returns a stream that polls this node for events.
Source§

impl<N, C, I> NodeImpl for Delegate<N, C, I>
where N: NodeImpl + LeadershipAwareNode<I> + 'static, C: Config<Node = N> + 'static,

Source§

fn append_impl<A, P, R>( &mut self, applicable: A, args: P, ) -> BoxFuture<'static, ImplAppendResultFor<Self, A, R>>
where A: ApplicableTo<StateOf<Self>> + 'static, P: Into<AppendArgs<Self::Invocation, R>>, R: RetryPolicy<Invocation = Self::Invocation>,

Appends applicable to the shared log.
Source§

fn await_commit_of( &mut self, log_entry_id: LogEntryIdOf<Self>, ) -> BoxFuture<'static, Result<CommitFor<Self>, ShutDown>>

Wait for the log entry with the given ID to be committed.
Source§

fn eject( &mut self, reason: EjectionOf<Self>, ) -> BoxFuture<'static, Result<bool, ShutDown>>

Eject the node’s state. Read more
Source§

fn poll( &mut self, round_num: RoundNumOf<Self>, additional_nodes: Vec<NodeOf<Self>>, ) -> BoxFuture<'static, Result<bool, PollError<Self::Invocation>>>

Polls the given nodes for the log entry to apply to the given round. Read more

Auto Trait Implementations§

§

impl<N, C, I = ()> !Freeze for Delegate<N, C, I>

§

impl<N, C, I = ()> !RefUnwindSafe for Delegate<N, C, I>

§

impl<N, C, I> Send for Delegate<N, C, I>
where N: Send, C: Send, I: Send,

§

impl<N, C, I = ()> !Sync for Delegate<N, C, I>

§

impl<N, C, I> Unpin for Delegate<N, C, I>
where N: Unpin, C: Unpin, I: Unpin,

§

impl<N, C, I> UnsafeUnpin for Delegate<N, C, I>
where N: UnsafeUnpin, C: UnsafeUnpin,

§

impl<N, C, I = ()> !UnwindSafe for Delegate<N, C, I>

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<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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<D, I> LeadershipAwareNode<(I,)> for D

Source§

fn lax_leadership( &self, ) -> &[Leadership<<<<<D as Node>::Invocation as Invocation>::State as State>::Node as NodeInfo>::Id, <<D as Node>::Invocation as Invocation>::RoundNum, <<D as Node>::Invocation as Invocation>::CoordNum>]

Leadership as assumed by this node. Read more
Source§

fn strict_leadership( &self, ) -> &[Leadership<<<<<D as Node>::Invocation as Invocation>::State as State>::Node as NodeInfo>::Id, <<D as Node>::Invocation as Invocation>::RoundNum, <<D as Node>::Invocation as Invocation>::CoordNum>]

Leadership as assumed by this node. Read more
Source§

impl<D, I> MasterLeasingNode<(I,)> for D

Source§

fn read_master_lax<F, T>( &self, f: F, ) -> Pin<Box<dyn Future<Output = Option<T>> + '_>>
where F: FnOnce(&<<D as Node>::Invocation as Invocation>::State) -> T + Send + 'static, T: Send + 'static,

Source§

fn read_master_strict<F, T>( &self, f: F, ) -> Pin<Box<dyn Future<Output = Option<T>> + '_>>
where F: FnOnce(&<<D as Node>::Invocation as Invocation>::State) -> T + Send + 'static, T: Send + 'static,

Source§

impl<D, I> MaybeLeadershipAwareNode<(I,)> for D
where D: Decoration + 'static, <D as Decoration>::Decorated: MaybeLeadershipAwareNode<I>,

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