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<DynNodeManager>>
pub fn iter(&self) -> impl Iterator<Item = &Arc<DynNodeManager>>
Iterate by reference over the node managers.
Sourcepub fn new(node_managers: Vec<Arc<DynNodeManager>>) -> Self
pub fn new(node_managers: Vec<Arc<DynNodeManager>>) -> Self
Create a new node manager collection from a vector of node managers.
Sourcepub fn get_of_type<T: NodeManager + Send + Sync + Any>(&self) -> Option<Arc<T>>
pub fn get_of_type<T: NodeManager + Send + Sync + Any>(&self) -> Option<Arc<T>>
Get the first node manager with the specified type.
Sourcepub fn get_by_name<T: NodeManager + Send + Sync + Any>(
&self,
name: &str,
) -> Option<Arc<T>>
pub fn get_by_name<T: NodeManager + Send + Sync + Any>( &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
Returns a duplicate 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 Index<usize> for NodeManagers
impl Index<usize> for NodeManagers
Source§impl<'a> IntoIterator for &'a NodeManagers
impl<'a> IntoIterator for &'a NodeManagers
Source§impl NodeManagerCollection for NodeManagers
impl NodeManagerCollection for NodeManagers
Source§fn iter_node_managers(&self) -> impl Iterator<Item = Arc<DynNodeManager>>
fn iter_node_managers(&self) -> impl Iterator<Item = Arc<DynNodeManager>>
Iterate over the node managers on the server.
Auto Trait Implementations§
impl Freeze for NodeManagers
impl !RefUnwindSafe for NodeManagers
impl Send for NodeManagers
impl Sync for NodeManagers
impl Unpin for NodeManagers
impl !UnwindSafe for NodeManagers
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