pub struct NodeManagersRef { /* private fields */ }
Expand description
A weak reference to the node manager collection.
Implementations§
Source§impl NodeManagersRef
impl NodeManagersRef
Sourcepub fn upgrade(&self) -> Option<NodeManagers>
pub fn upgrade(&self) -> Option<NodeManagers>
Upgrade this node manager ref. Note that node managers should avoid keeping a permanent copy of the NodeManagers struct, to avoid circular references leading to a memory leak when the server is dropped.
If this fails, it means that the server is dropped, so feel free to abort anything going on.
Sourcepub fn iter(&self) -> impl Iterator<Item = Arc<DynNodeManager>>
pub fn iter(&self) -> impl Iterator<Item = Arc<DynNodeManager>>
Iterate over node managers. If the server is dropped this iterator will be empty.
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.
Trait Implementations§
Source§impl Clone for NodeManagersRef
impl Clone for NodeManagersRef
Source§fn clone(&self) -> NodeManagersRef
fn clone(&self) -> NodeManagersRef
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 NodeManagerCollection for NodeManagersRef
impl NodeManagerCollection for NodeManagersRef
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 NodeManagersRef
impl !RefUnwindSafe for NodeManagersRef
impl Send for NodeManagersRef
impl Sync for NodeManagersRef
impl Unpin for NodeManagersRef
impl !UnwindSafe for NodeManagersRef
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