Struct paxakos::NodeHandle
source · [−]pub struct NodeHandle<I: Invocation> { /* private fields */ }
Expand description
A remote handle for a paxakos Node
.
Implementations
sourceimpl<I: Invocation> NodeHandle<I>
impl<I: Invocation> NodeHandle<I>
sourcepub fn status(&self) -> impl Future<Output = Result<NodeStatus, ShutDown>>
pub fn status(&self) -> impl Future<Output = Result<NodeStatus, ShutDown>>
Node’s current status.
sourcepub fn prepare_snapshot(
&self
) -> impl Future<Output = Result<SnapshotFor<I>, ShutDown>>
pub fn prepare_snapshot(
&self
) -> impl Future<Output = Result<SnapshotFor<I>, ShutDown>>
Requests that snapshot of the node’s current state be taken.
sourcepub fn affirm_snapshot(
&self,
snapshot: SnapshotFor<I>
) -> impl Future<Output = Result<(), AffirmSnapshotError>>
pub fn affirm_snapshot(
&self,
snapshot: SnapshotFor<I>
) -> impl Future<Output = Result<(), AffirmSnapshotError>>
Affirms that the given snapshot was written to persistent storage.
Currently does nothing.
sourcepub fn install_snapshot(
&self,
snapshot: SnapshotFor<I>
) -> impl Future<Output = Result<(), InstallSnapshotError>>
pub fn install_snapshot(
&self,
snapshot: SnapshotFor<I>
) -> impl Future<Output = Result<(), InstallSnapshotError>>
Requests that the given snapshot be installed.
sourcepub fn read_stale<F, T>(
&self,
f: F
) -> impl Future<Output = Result<T, ReadStaleError>> where
F: FnOnce(&StateOf<I>) -> T + Send + 'static,
T: Send + 'static,
pub fn read_stale<F, T>(
&self,
f: F
) -> impl Future<Output = Result<T, ReadStaleError>> where
F: FnOnce(&StateOf<I>) -> T + Send + 'static,
T: Send + 'static,
Reads the node’s current state.
As the name implies the state may be stale, i.e. other node’s may have advanced the shared state without this node being aware.
sourcepub fn append<A, P, R>(
&self,
applicable: A,
args: P
) -> impl Future<Output = Result<CommitFor<I, A>, R::StaticError>> where
A: ApplicableTo<StateOf<I>>,
P: Into<AppendArgs<I, R>>,
R: RetryPolicy<Invocation = I> + Send + 'static,
R::Error: Send,
R::StaticError: From<ShutDownOr<R::Error>>,
R::Future: Send,
pub fn append<A, P, R>(
&self,
applicable: A,
args: P
) -> impl Future<Output = Result<CommitFor<I, A>, R::StaticError>> where
A: ApplicableTo<StateOf<I>>,
P: Into<AppendArgs<I, R>>,
R: RetryPolicy<Invocation = I> + Send + 'static,
R::Error: Send,
R::StaticError: From<ShutDownOr<R::Error>>,
R::Future: Send,
Appends applicable
to the shared log.
Trait Implementations
sourceimpl<I: Invocation> Admin for NodeHandle<I>
impl<I: Invocation> Admin for NodeHandle<I>
sourceimpl<I: Invocation> Clone for NodeHandle<I>
impl<I: Invocation> Clone for NodeHandle<I>
sourceimpl<I: Invocation> Debug for NodeHandle<I>
impl<I: Invocation> Debug for NodeHandle<I>
Auto Trait Implementations
impl<I> !RefUnwindSafe for NodeHandle<I>
impl<I> Send for NodeHandle<I>
impl<I> Sync for NodeHandle<I>
impl<I> Unpin for NodeHandle<I>
impl<I> !UnwindSafe for NodeHandle<I>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more