pub struct NodeCapabilities { /* private fields */ }Expand description
Information about a node’s capabilities and resource usage
Implementations§
Source§impl NodeCapabilities
impl NodeCapabilities
Sourcepub fn new(
memory_usage: usize,
compute_capability: usize,
learning_capability: bool,
feature_count: usize,
) -> Self
pub fn new( memory_usage: usize, compute_capability: usize, learning_capability: bool, feature_count: usize, ) -> Self
Create a new instance of NodeCapabilities
Sourcepub const fn compute_capability(&self) -> usize
pub const fn compute_capability(&self) -> usize
returns a copy of the computational capability of the node
Sourcepub const fn compute_capability_mut(&mut self) -> &mut usize
pub const fn compute_capability_mut(&mut self) -> &mut usize
returns a mutable reference to the computational capability of the node
Sourcepub const fn feature_count(&self) -> usize
pub const fn feature_count(&self) -> usize
returns a copy of the feature count of the node
Sourcepub const fn feature_count_mut(&mut self) -> &mut usize
pub const fn feature_count_mut(&mut self) -> &mut usize
returns a mutable reference to the feature count of the node
Sourcepub const fn learning_capability(&self) -> bool
pub const fn learning_capability(&self) -> bool
returns a copy of the learning capability of the node
Sourcepub const fn learning_capability_mut(&mut self) -> &mut bool
pub const fn learning_capability_mut(&mut self) -> &mut bool
returns a mutable reference to the learning capability of the node
Sourcepub const fn memory_usage(&self) -> usize
pub const fn memory_usage(&self) -> usize
returns a copy of the memory usage of the node
Sourcepub const fn memory_usage_mut(&mut self) -> &mut usize
pub const fn memory_usage_mut(&mut self) -> &mut usize
returns a mutable reference to the memory usage of the node
Sourcepub fn set_compute_capability(&mut self, compute_capability: usize) -> &mut Self
pub fn set_compute_capability(&mut self, compute_capability: usize) -> &mut Self
updates the computational capability of the node and returns a mutable reference to the instance
Sourcepub fn set_feature_count(&mut self, feature_count: usize) -> &mut Self
pub fn set_feature_count(&mut self, feature_count: usize) -> &mut Self
updates the feature count of the node and returns a mutable reference to the instance
Sourcepub fn set_learning_capability(
&mut self,
learning_capability: bool,
) -> &mut Self
pub fn set_learning_capability( &mut self, learning_capability: bool, ) -> &mut Self
updates the learning capability of the node and returns a mutable reference to the instance
Sourcepub fn set_memory_usage(&mut self, memory_usage: usize) -> &mut Self
pub fn set_memory_usage(&mut self, memory_usage: usize) -> &mut Self
updates the memory usage of the node and returns a mutable reference to the instance
Sourcepub fn with_compute_capability(self, compute_capability: usize) -> Self
pub fn with_compute_capability(self, compute_capability: usize) -> Self
returns a copy of the memory usage of the node
Sourcepub fn with_feature_count(self, feature_count: usize) -> Self
pub fn with_feature_count(self, feature_count: usize) -> Self
returns a new instance with the given feature count
Sourcepub fn with_learning_capability(self, learning_capability: bool) -> Self
pub fn with_learning_capability(self, learning_capability: bool) -> Self
returns a new instance with the given learning capability
Sourcepub fn with_memory_usage(self, memory_usage: usize) -> Self
pub fn with_memory_usage(self, memory_usage: usize) -> Self
returns a new instance with the given memory usage
Trait Implementations§
Source§impl Clone for NodeCapabilities
impl Clone for NodeCapabilities
Source§fn clone(&self) -> NodeCapabilities
fn clone(&self) -> NodeCapabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NodeCapabilities
impl Debug for NodeCapabilities
Source§impl Default for NodeCapabilities
impl Default for NodeCapabilities
Source§fn default() -> NodeCapabilities
fn default() -> NodeCapabilities
Source§impl<'de> Deserialize<'de> for NodeCapabilities
impl<'de> Deserialize<'de> for NodeCapabilities
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for NodeCapabilities
impl Hash for NodeCapabilities
Source§impl Ord for NodeCapabilities
impl Ord for NodeCapabilities
Source§fn cmp(&self, other: &NodeCapabilities) -> Ordering
fn cmp(&self, other: &NodeCapabilities) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for NodeCapabilities
impl PartialEq for NodeCapabilities
Source§impl PartialOrd for NodeCapabilities
impl PartialOrd for NodeCapabilities
Source§impl Serialize for NodeCapabilities
impl Serialize for NodeCapabilities
impl Copy for NodeCapabilities
impl Eq for NodeCapabilities
impl StructuralPartialEq for NodeCapabilities
Auto Trait Implementations§
impl Freeze for NodeCapabilities
impl RefUnwindSafe for NodeCapabilities
impl Send for NodeCapabilities
impl Sync for NodeCapabilities
impl Unpin for NodeCapabilities
impl UnwindSafe for NodeCapabilities
Blanket Implementations§
Source§impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
impl<T> AsWeight<T> for Twhere
T: Clone + IntoWeight<T>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<K, S> Identity<K> for Swhere
S: Borrow<K>,
K: Identifier,
impl<K, S> Identity<K> for Swhere
S: Borrow<K>,
K: Identifier,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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