pub struct MachineRegistry { /* private fields */ }Expand description
Registry mapping process IPs to their resolved locality.
Parallel to TagRegistry but for failure
domains: supports shared-fate queries (all IPs on a machine, in a zone, or in
a datacenter).
Implementations§
Source§impl MachineRegistry
impl MachineRegistry
Sourcepub fn register(&mut self, ip: IpAddr, locality: LocalityInfo)
pub fn register(&mut self, ip: IpAddr, locality: LocalityInfo)
Register locality for a process IP.
Sourcepub fn locality_for(&self, ip: IpAddr) -> Option<&LocalityInfo>
pub fn locality_for(&self, ip: IpAddr) -> Option<&LocalityInfo>
Get the locality for a specific IP.
Sourcepub fn ips_in_domain(&self, level: DomainLevel, id: &str) -> Vec<IpAddr>
pub fn ips_in_domain(&self, level: DomainLevel, id: &str) -> Vec<IpAddr>
Find all IPs whose domain at level matches id.
Sourcepub fn ips_on_machine(&self, machine_id: &str) -> Vec<IpAddr>
pub fn ips_on_machine(&self, machine_id: &str) -> Vec<IpAddr>
Find all IPs on a single machine — the unit of shared fate.
Sourcepub fn all_machines(&self) -> Vec<String>
pub fn all_machines(&self) -> Vec<String>
All distinct machine ids, sorted for determinism.
Sourcepub fn all_datacenters(&self) -> Vec<String>
pub fn all_datacenters(&self) -> Vec<String>
All distinct datacenter ids, sorted for determinism.
Trait Implementations§
Source§impl Clone for MachineRegistry
impl Clone for MachineRegistry
Source§fn clone(&self) -> MachineRegistry
fn clone(&self) -> MachineRegistry
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 MachineRegistry
impl Debug for MachineRegistry
Source§impl Default for MachineRegistry
impl Default for MachineRegistry
Source§fn default() -> MachineRegistry
fn default() -> MachineRegistry
Returns the “default value” for a type. Read more
Source§impl PartialEq for MachineRegistry
impl PartialEq for MachineRegistry
Source§fn eq(&self, other: &MachineRegistry) -> bool
fn eq(&self, other: &MachineRegistry) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MachineRegistry
Auto Trait Implementations§
impl Freeze for MachineRegistry
impl RefUnwindSafe for MachineRegistry
impl Send for MachineRegistry
impl Sync for MachineRegistry
impl Unpin for MachineRegistry
impl UnsafeUnpin for MachineRegistry
impl UnwindSafe for MachineRegistry
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