pub struct ConfDynSeed { /* private fields */ }Expand description
A dyn_seeds: entry: a peer dynomite node with rack / dc / tokens.
§Examples
use dynomite::conf::ConfDynSeed;
let s = ConfDynSeed::parse("127.0.0.2:8101:rack2:dc2:1383429731").unwrap();
assert_eq!(s.rack(), "rack2");
assert_eq!(s.dc(), "dc2");Implementations§
Source§impl ConfDynSeed
impl ConfDynSeed
Sourcepub fn parse(raw: &str) -> Result<Self, ConfError>
pub fn parse(raw: &str) -> Result<Self, ConfError>
Parse a host:port:rack:dc:tokens [name] entry.
§Examples
use dynomite::conf::ConfDynSeed;
let s = ConfDynSeed::parse("h:1:r:d:1,2,3 friendly").unwrap();
assert_eq!(s.tokens().len(), 3);
assert_eq!(s.name(), "friendly");
assert!(ConfDynSeed::parse("a:b:c:d").is_err());Sourcepub fn pname(&self) -> &str
pub fn pname(&self) -> &str
The colon-joined host:port portion (rack, dc and tokens are
stripped from the input during parsing).
§Examples
use dynomite::conf::ConfDynSeed;
let s = ConfDynSeed::parse("h:1:r:d:1 friendly").unwrap();
assert_eq!(s.pname(), "h:1");Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Hashing-key name.
§Examples
use dynomite::conf::ConfDynSeed;
assert_eq!(
ConfDynSeed::parse("h:1:r:d:1 friendly").unwrap().name(),
"friendly",
);Sourcepub fn host(&self) -> &str
pub fn host(&self) -> &str
Hostname or IP.
§Examples
use dynomite::conf::ConfDynSeed;
assert_eq!(ConfDynSeed::parse("node-a:1:r:d:1").unwrap().host(), "node-a");Sourcepub fn port(&self) -> u16
pub fn port(&self) -> u16
TCP port.
§Examples
use dynomite::conf::ConfDynSeed;
assert_eq!(ConfDynSeed::parse("h:8101:r:d:1").unwrap().port(), 8101);Sourcepub fn rack(&self) -> &str
pub fn rack(&self) -> &str
Logical rack.
§Examples
use dynomite::conf::ConfDynSeed;
assert_eq!(ConfDynSeed::parse("h:1:rack-x:d:1").unwrap().rack(), "rack-x");Trait Implementations§
Source§impl Clone for ConfDynSeed
impl Clone for ConfDynSeed
Source§fn clone(&self) -> ConfDynSeed
fn clone(&self) -> ConfDynSeed
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 ConfDynSeed
impl Debug for ConfDynSeed
Source§impl<'de> Deserialize<'de> for ConfDynSeed
impl<'de> Deserialize<'de> for ConfDynSeed
Source§fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ConfDynSeed
impl Display for ConfDynSeed
Source§impl PartialEq for ConfDynSeed
impl PartialEq for ConfDynSeed
Source§fn eq(&self, other: &ConfDynSeed) -> bool
fn eq(&self, other: &ConfDynSeed) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ConfDynSeed
impl Serialize for ConfDynSeed
impl Eq for ConfDynSeed
impl StructuralPartialEq for ConfDynSeed
Auto Trait Implementations§
impl Freeze for ConfDynSeed
impl RefUnwindSafe for ConfDynSeed
impl Send for ConfDynSeed
impl Sync for ConfDynSeed
impl Unpin for ConfDynSeed
impl UnsafeUnpin for ConfDynSeed
impl UnwindSafe for ConfDynSeed
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.