pub struct NodeManagers { /* private fields */ }Expand description
Wrapper around the server managed list of node managers.
Implementations§
Source§impl NodeManagers
impl NodeManagers
Sourcepub fn iter(&self) -> impl Iterator<Item = &Arc<dyn NodeManager + Sync + Send>>
pub fn iter(&self) -> impl Iterator<Item = &Arc<dyn NodeManager + Sync + Send>>
Iterate by reference over the node managers.
Sourcepub fn new(
node_managers: Vec<Arc<dyn NodeManager + Sync + Send>>,
) -> NodeManagers
pub fn new( node_managers: Vec<Arc<dyn NodeManager + Sync + Send>>, ) -> NodeManagers
Create a new node manager collection from a vector of node managers.
Sourcepub fn get(&self, index: usize) -> Option<&Arc<dyn NodeManager + Sync + Send>>
pub fn get(&self, index: usize) -> Option<&Arc<dyn NodeManager + Sync + Send>>
Get a node manager by index.
Sourcepub fn get_of_type<T>(&self) -> Option<Arc<T>>
pub fn get_of_type<T>(&self) -> Option<Arc<T>>
Get the first node manager with the specified type.
Sourcepub fn get_by_name<T>(&self, name: &str) -> Option<Arc<T>>
pub fn get_by_name<T>(&self, name: &str) -> Option<Arc<T>>
Get the first node manager with the specified name and try to cast it to the type T.
If there are multiple node managers with the same name, only the first will ever be returned by this. Avoid having duplicate node managers.
Sourcepub fn as_weak(&self) -> NodeManagersRef
pub fn as_weak(&self) -> NodeManagersRef
Create a weak reference to the node managers.
A node manager should avoid holding a copy of the NodeManagers object since that
results in a circular reference which will leak memory once dropped.
(This does not really matter if you don’t care about memory leaks when the server is dropped.)
Trait Implementations§
Source§impl Clone for NodeManagers
impl Clone for NodeManagers
Source§fn clone(&self) -> NodeManagers
fn clone(&self) -> NodeManagers
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more