pub struct Cluster {
pub local_host: LocalHost,
/* private fields */
}
18
19
20
21
22
23
24
25
26
27
28
pub fn new(options: Option<ClusterOptions>) -> Result<Cluster, ParseError> {
let real_options = options.unwrap_or(ClusterOptions::default());
let local_host = LocalHost::new(Some(real_options.local_host))?;
let mut cluster = Cluster {
local_host,
remote_hosts: HashMap::new(),
nodes: HashMap::new(),
};
cluster.resize(real_options.size);
Ok(cluster)
}
Formats the value using the given formatter.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.