pub struct TopologySnapshot { /* private fields */ }Expand description
Immutable topology snapshot with unique host identities.
Implementations§
Source§impl TopologySnapshot
impl TopologySnapshot
Sourcepub fn new<I>(hosts: I) -> Result<Self, TopologyError>where
I: IntoIterator<Item = HostRecord>,
pub fn new<I>(hosts: I) -> Result<Self, TopologyError>where
I: IntoIterator<Item = HostRecord>,
Builds a snapshot and rejects duplicate host identities.
Sourcepub fn revision(&self) -> &TopologyRevision
pub fn revision(&self) -> &TopologyRevision
Returns the snapshot revision.
Sourcepub fn get(&self, id: &HostId) -> Option<&HostRecord>
pub fn get(&self, id: &HostId) -> Option<&HostRecord>
Returns a host by stable identity.
Sourcepub fn hosts(&self) -> impl Iterator<Item = &HostRecord>
pub fn hosts(&self) -> impl Iterator<Item = &HostRecord>
Iterates over hosts in identity order.
Trait Implementations§
Source§impl Clone for TopologySnapshot
impl Clone for TopologySnapshot
Source§fn clone(&self) -> TopologySnapshot
fn clone(&self) -> TopologySnapshot
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 TopologySnapshot
impl Debug for TopologySnapshot
Source§impl<'de> Deserialize<'de> for TopologySnapshot
impl<'de> Deserialize<'de> for TopologySnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TopologySnapshot
impl PartialEq for TopologySnapshot
Source§fn eq(&self, other: &TopologySnapshot) -> bool
fn eq(&self, other: &TopologySnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TopologySnapshot
impl Serialize for TopologySnapshot
impl Eq for TopologySnapshot
impl StructuralPartialEq for TopologySnapshot
Auto Trait Implementations§
impl Freeze for TopologySnapshot
impl RefUnwindSafe for TopologySnapshot
impl Send for TopologySnapshot
impl Sync for TopologySnapshot
impl Unpin for TopologySnapshot
impl UnsafeUnpin for TopologySnapshot
impl UnwindSafe for TopologySnapshot
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.