pub struct PeerSnapshot {
pub idx: u32,
pub host: String,
pub port: u16,
pub dc: String,
pub rack: String,
pub state: PeerState,
pub tokens: Vec<DynToken>,
pub is_local: bool,
}Expand description
Owned snapshot of one peer in the cluster ring.
§Examples
use dynomite::embed::PeerSnapshot;
use dynomite::cluster::peer::{Peer, PeerEndpoint, PeerState};
use dynomite::hashkit::DynToken;
let p = Peer::new(
0, PeerEndpoint::tcp("h".into(), 1), "r".into(), "d".into(),
vec![DynToken::from_u32(0)], true, true, false,
);
let snap = PeerSnapshot::from(&p);
assert_eq!(snap.idx, 0);Fields§
§idx: u32Index of the peer in the pool’s peer array.
host: StringHostname or IP.
port: u16TCP port.
dc: StringDatacenter name.
rack: StringRack name.
state: PeerStateLifecycle state.
tokens: Vec<DynToken>Token list at snapshot time.
is_local: boolTrue for the local node.
Implementations§
Trait Implementations§
Source§impl Clone for PeerSnapshot
impl Clone for PeerSnapshot
Source§fn clone(&self) -> PeerSnapshot
fn clone(&self) -> PeerSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PeerSnapshot
impl Debug for PeerSnapshot
Source§impl From<&Peer> for PeerSnapshot
impl From<&Peer> for PeerSnapshot
Source§impl PartialEq for PeerSnapshot
impl PartialEq for PeerSnapshot
Source§fn eq(&self, other: &PeerSnapshot) -> bool
fn eq(&self, other: &PeerSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PeerSnapshot
impl StructuralPartialEq for PeerSnapshot
Auto Trait Implementations§
impl Freeze for PeerSnapshot
impl RefUnwindSafe for PeerSnapshot
impl Send for PeerSnapshot
impl Sync for PeerSnapshot
impl Unpin for PeerSnapshot
impl UnsafeUnpin for PeerSnapshot
impl UnwindSafe for PeerSnapshot
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.