pub struct ClusterMember { /* private fields */ }Expand description
One authorized cluster member.
The NodeIdentity is the member’s stable cluster identity — the same
validated X.509 subject it authenticates and votes under. owned_range_count
is the per-range role count, kept deliberately separate: a member’s
cluster identity does not change when ranges move on or off it, and a
freshly joined data member starts at zero.
Implementations§
Source§impl ClusterMember
impl ClusterMember
Sourcepub fn joined_empty(identity: NodeIdentity, kind: MemberKind) -> ClusterMember
pub fn joined_empty(identity: NodeIdentity, kind: MemberKind) -> ClusterMember
A member as it exists immediately after a successful join: authorized, of the granted kind, and holding no user ranges. Ranges are only assigned later by rebalancing or ownership transitions.
pub fn identity(&self) -> &NodeIdentity
pub fn kind(&self) -> MemberKind
Sourcepub fn owned_range_count(&self) -> usize
pub fn owned_range_count(&self) -> usize
How many user ranges this member currently owns. Distinct from cluster membership: a member with zero ranges is still a full member.
Sourcepub fn holds_user_ranges(&self) -> bool
pub fn holds_user_ranges(&self) -> bool
Does this member currently hold any user ranges? A just-joined member
answers false until the rebalancer assigns ownership.
Sourcepub fn assign_ranges(&mut self, count: usize)
pub fn assign_ranges(&mut self, count: usize)
Record that the rebalancer/ownership transitions have assigned this many user ranges to the member. This is the only path that gives a member ranges — join never does.
Trait Implementations§
Source§impl Clone for ClusterMember
impl Clone for ClusterMember
Source§fn clone(&self) -> ClusterMember
fn clone(&self) -> ClusterMember
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClusterMember
impl Debug for ClusterMember
impl Eq for ClusterMember
Source§impl PartialEq for ClusterMember
impl PartialEq for ClusterMember
Source§fn eq(&self, other: &ClusterMember) -> bool
fn eq(&self, other: &ClusterMember) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ClusterMember
Auto Trait Implementations§
impl Freeze for ClusterMember
impl RefUnwindSafe for ClusterMember
impl Send for ClusterMember
impl Sync for ClusterMember
impl Unpin for ClusterMember
impl UnsafeUnpin for ClusterMember
impl UnwindSafe for ClusterMember
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request