Module std.net.cluster

Inspect this node's current cluster membership and registered names.

Watches coalesce readiness and re-read authoritative snapshots. They are not lossless event logs. Locations are discovery metadata, never actor authority.

Contents

Functions

Function snapshot

pub fn snapshot() -> Snapshot fails ObserveError

Copy current canonical metadata. Both registration views are local knowledge, not a quorum, a liveness guarantee or callable actor authority.

Function watch

pub fn watch() -> Subscription fails ObserveError

Subscribe before reading the initial snapshot, without a lost-change window.

Function wait_registered

pub fn wait_registered(name: string) -> Location fails ObserveError

Wait cancellably until the name currently resolves in this node's view. No request is replayed and the returned Location grants no actor access.

Function wait_departed

pub fn wait_departed(target: Member) -> () fails ObserveError

Wait until this exact member session is absent, Dead or Left in the local view. A higher-session rejoin cannot hide the predecessor's departure.

Types

Enum ObserveError

Variants

NotRunning
Limit

Enum State

Variants

Alive
Suspect
Dead
Left

Struct Member

One node session in this node's authenticated membership view.

Fields

id: NodeId
session: u32
state: State

Struct Registration

An exact discovery location. This value grants no actor access.

Fields

name: string
location: Location

Struct Snapshot

Immutable local knowledge, including both local and remote registrations.

Fields

local: Member
members: Vec<Member>
registrations: Vec<Registration>

Struct Subscription

A single owner of one node-instance subscription.

initial is taken after subscribing. Several mutations may yield one readiness item, or a racing mutation may already appear in initial. Receive readiness, then call snapshot() to read current knowledge. Reads never adopt a successor node. changes ends after teardown finishes.

Fields

initial: Snapshot
changes: stream.Stream<()>
handle: NativeWatch

Inherent methods

impl Snapshot

fn local_registrations(self) -> Vec<Registration>

Restrict the registration view to this node's own stable identity.

impl Subscription

fn snapshot(self) -> Snapshot fails ObserveError

Read the subscribed instance, or NotRunning once its admission closes.

fn wait_shutdown(self)

Wait for this instance's teardown to finish. Ordinary scope cancellation releases the wait; it does not request node shutdown.