Struct NodeManagers

Source
pub struct NodeManagers { /* private fields */ }
Expand description

Wrapper around the server managed list of node managers.

Implementations§

Source§

impl NodeManagers

Source

pub fn iter(&self) -> impl Iterator<Item = &Arc<DynNodeManager>>

Iterate by reference over the node managers.

Source

pub fn len(&self) -> usize

Get the length of the node manager collection.

Source

pub fn is_empty(&self) -> bool

Return true if the node manager collection is empty.

Source

pub fn new(node_managers: Vec<Arc<DynNodeManager>>) -> Self

Create a new node manager collection from a vector of node managers.

Source

pub fn get(&self, index: usize) -> Option<&Arc<DynNodeManager>>

Get a node manager by index.

Source

pub fn get_of_type<T: NodeManager + Send + Sync + Any>(&self) -> Option<Arc<T>>

Get the first node manager with the specified type.

Source

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.

Source

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

Source§

fn clone(&self) -> NodeManagers

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Index<usize> for NodeManagers

Source§

type Output = Arc<dyn NodeManager + Sync + Send>

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a> IntoIterator for &'a NodeManagers

Source§

type Item = &'a Arc<dyn NodeManager + Sync + Send>

The type of the elements being iterated over.
Source§

type IntoIter = <&'a Vec<Arc<dyn NodeManager + Sync + Send>> as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl NodeManagerCollection for NodeManagers

Source§

fn iter_node_managers(&self) -> impl Iterator<Item = Arc<DynNodeManager>>

Iterate over the node managers on the server.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoAnyArc for T
where T: Send + Sync + 'static,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Upcast to Arc<dyn Any>.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T