pub struct LocalityInfo { /* private fields */ }Expand description
Resolved failure-domain locality for a single process instance.
Identifiers are globally unique and hierarchical (dc1, dc1-z1,
dc1-z1-m1) so that domain queries never confuse a machine in one
datacenter with a machine in another.
Implementations§
Source§impl LocalityInfo
impl LocalityInfo
Sourcepub fn new(
datacenter: impl Into<String>,
zone: impl Into<String>,
machine: impl Into<String>,
) -> Self
pub fn new( datacenter: impl Into<String>, zone: impl Into<String>, machine: impl Into<String>, ) -> Self
Create locality from explicit datacenter, zone, and machine ids.
Sourcepub fn datacenter(&self) -> &str
pub fn datacenter(&self) -> &str
The datacenter id (e.g. dc1).
Sourcepub fn id_for(&self, level: DomainLevel) -> &str
pub fn id_for(&self, level: DomainLevel) -> &str
The id at the given domain level.
Trait Implementations§
Source§impl Clone for LocalityInfo
impl Clone for LocalityInfo
Source§fn clone(&self) -> LocalityInfo
fn clone(&self) -> LocalityInfo
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 LocalityInfo
impl Debug for LocalityInfo
Source§impl Default for LocalityInfo
impl Default for LocalityInfo
Source§fn default() -> LocalityInfo
fn default() -> LocalityInfo
Returns the “default value” for a type. Read more
impl Eq for LocalityInfo
Source§impl PartialEq for LocalityInfo
impl PartialEq for LocalityInfo
Source§fn eq(&self, other: &LocalityInfo) -> bool
fn eq(&self, other: &LocalityInfo) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LocalityInfo
Auto Trait Implementations§
impl Freeze for LocalityInfo
impl RefUnwindSafe for LocalityInfo
impl Send for LocalityInfo
impl Sync for LocalityInfo
impl Unpin for LocalityInfo
impl UnsafeUnpin for LocalityInfo
impl UnwindSafe for LocalityInfo
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