pub struct NodeCluster {
controller_id: Endpoint,
nodes: Box<[Node]>,
}
Expand description
A globally identified set of nodes that are all located in the same controller.
Sometimes it is more convenient to think about such a group instead of
individual GlobalNode
s
Fields§
§controller_id: Endpoint
§nodes: Box<[Node]>
Implementations§
Source§impl NodeCluster
impl NodeCluster
Sourcepub fn new(
controller_id: Endpoint,
nodes: impl IntoIterator<Item = Node>,
) -> Self
pub fn new( controller_id: Endpoint, nodes: impl IntoIterator<Item = Node>, ) -> Self
Create a new cluster. This for internal use.
Sourcepub fn controller_id(&self) -> Endpoint
pub fn controller_id(&self) -> Endpoint
Controller that these nodes belong to
Sourcepub fn try_from_iter(iter: impl IntoIterator<Item = GlobalNode>) -> Option<Self>
pub fn try_from_iter(iter: impl IntoIterator<Item = GlobalNode>) -> Option<Self>
Attempt to collect an iterator of nodes into a cluster
Returns None
if the iterator was empty or if two nodes did
not have identical controller id’s
Trait Implementations§
Source§impl Clone for NodeCluster
impl Clone for NodeCluster
Source§fn clone(&self) -> NodeCluster
fn clone(&self) -> NodeCluster
Returns a copy of the value. Read more
1.0.0 · 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 NodeCluster
impl Debug for NodeCluster
Source§impl Hash for NodeCluster
impl Hash for NodeCluster
Source§impl<'a> IntoIterGlobalNodes for &'a NodeCluster
impl<'a> IntoIterGlobalNodes for &'a NodeCluster
Source§type Iter = Iter<'a>
type Iter = Iter<'a>
The iterator returned by
Self::iter_nodes
Source§fn iter_nodes(self) -> Self::Iter
fn iter_nodes(self) -> Self::Iter
iterate over the local nodes
Source§fn controller_id(self) -> Endpoint
fn controller_id(self) -> Endpoint
The controller id all of these nodes are located in.
Source§fn iter_global_nodes(self) -> GlobalNodeIter<Self> ⓘ
fn iter_global_nodes(self) -> GlobalNodeIter<Self> ⓘ
Iterate all nodes as globally identified one’s. Read more
Source§fn extended(self, other: impl IntoIterGlobalNodes) -> Option<NodeCluster>
fn extended(self, other: impl IntoIterGlobalNodes) -> Option<NodeCluster>
A convenience method for gathering multiple node(cluster)s together. Read more
Source§fn to_local_cluster(self) -> NodeCluster
fn to_local_cluster(self) -> NodeCluster
Collect the iterator into a cluster
Auto Trait Implementations§
impl Freeze for NodeCluster
impl RefUnwindSafe for NodeCluster
impl Send for NodeCluster
impl Sync for NodeCluster
impl Unpin for NodeCluster
impl UnwindSafe for NodeCluster
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more