Struct paxakos::node::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 read_stale_scoped<'read, F, T>(
&self,
f: F
) -> impl Future<Output = Result<T, ReadStaleError>> + 'readwhere
F: FnOnce(&StateOf<I>) -> T + Send + 'read,
T: Send + 'static,
pub fn read_stale_scoped<'read, F, T>(
&self,
f: F
) -> impl Future<Output = Result<T, ReadStaleError>> + 'readwhere
F: FnOnce(&StateOf<I>) -> T + Send + 'read,
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 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