pub struct ResourceMetrics<T = f32> { /* private fields */ }Expand description
Resource metrics for a node
Implementations§
Source§impl<T> ResourceMetrics<T>
impl<T> ResourceMetrics<T>
pub fn new() -> Selfwhere
T: Default,
Sourcepub const fn capabilities(&self) -> &Vec<String>
pub const fn capabilities(&self) -> &Vec<String>
returns an immutable reference to the runtimes capabilities
Sourcepub const fn capabilities_mut(&mut self) -> &mut Vec<String>
pub const fn capabilities_mut(&mut self) -> &mut Vec<String>
returns a mutable reference to the runtimes capabilities
Sourcepub const fn available_compute(&self) -> usize
pub const fn available_compute(&self) -> usize
returns a copy of the available compute
Sourcepub const fn available_compute_mut(&mut self) -> &mut usize
pub const fn available_compute_mut(&mut self) -> &mut usize
returns a mutable reference to the available compute
Sourcepub const fn available_memory(&self) -> usize
pub const fn available_memory(&self) -> usize
returns a copy of the available memory
Sourcepub const fn available_memory_mut(&mut self) -> &mut usize
pub const fn available_memory_mut(&mut self) -> &mut usize
returns a mutable reference to the available memory
Sourcepub const fn cpu_usage_mut(&mut self) -> &mut T
pub const fn cpu_usage_mut(&mut self) -> &mut T
returns a mutable reference to the cpu usage
Sourcepub const fn edge_count(&self) -> usize
pub const fn edge_count(&self) -> usize
returns a copy of the edge count
Sourcepub const fn edge_count_mut(&mut self) -> &mut usize
pub const fn edge_count_mut(&mut self) -> &mut usize
returns a mutable reference to the edge count
Sourcepub const fn feature_count(&self) -> usize
pub const fn feature_count(&self) -> usize
returns a copy of the feature count
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
Sourcepub const fn learning_nodes(&self) -> usize
pub const fn learning_nodes(&self) -> usize
returns a copy of the learning nodes
Sourcepub const fn learning_nodes_mut(&mut self) -> &mut usize
pub const fn learning_nodes_mut(&mut self) -> &mut usize
returns a mutable reference to the learning nodes
Sourcepub const fn memory_usage(&self) -> &T
pub const fn memory_usage(&self) -> &T
returns a copy of the memory usage
Sourcepub const fn memory_usage_mut(&mut self) -> &mut T
pub const fn memory_usage_mut(&mut self) -> &mut T
returns a mutable reference to the memory usage
Sourcepub const fn partition_count(&self) -> usize
pub const fn partition_count(&self) -> usize
returns a copy of the partition count
Sourcepub const fn partition_count_mut(&mut self) -> &mut usize
pub const fn partition_count_mut(&mut self) -> &mut usize
returns a mutable reference to the partition count
Sourcepub const fn queued_tasks(&self) -> usize
pub const fn queued_tasks(&self) -> usize
returns a copy of the queued tasks
Sourcepub const fn queued_tasks_mut(&mut self) -> &mut usize
pub const fn queued_tasks_mut(&mut self) -> &mut usize
returns a mutable reference to the queued tasks
Sourcepub const fn running_tasks(&self) -> usize
pub const fn running_tasks(&self) -> usize
returns a copy of the running tasks
Sourcepub const fn running_tasks_mut(&mut self) -> &mut usize
pub const fn running_tasks_mut(&mut self) -> &mut usize
returns a mutable reference to the running tasks
Sourcepub const fn surface_network_count(&self) -> usize
pub const fn surface_network_count(&self) -> usize
returns a copy of the surface network count
Sourcepub const fn surface_network_count_mut(&mut self) -> &mut usize
pub const fn surface_network_count_mut(&mut self) -> &mut usize
returns a mutable reference to the surface network count
Sourcepub const fn vertex_count(&self) -> usize
pub const fn vertex_count(&self) -> usize
returns a copy of the vertex count
Sourcepub const fn vertex_count_mut(&mut self) -> &mut usize
pub const fn vertex_count_mut(&mut self) -> &mut usize
returns a mutable reference to the vertex count
Sourcepub fn set_available_compute(&mut self, compute: usize) -> &mut Self
pub fn set_available_compute(&mut self, compute: usize) -> &mut Self
updates the availible compute and returns a mutable reference to the current instance
Sourcepub fn set_available_memory(&mut self, memory: usize) -> &mut Self
pub fn set_available_memory(&mut self, memory: usize) -> &mut Self
updates the available memory and returns a mutable reference to the current instance
Sourcepub fn set_capabilities<I>(&mut self, iter: I) -> &mut Self
pub fn set_capabilities<I>(&mut self, iter: I) -> &mut Self
sets the runtimes capabilities
Sourcepub fn set_cpu_usage(&mut self, cpu_usage: T) -> &mut Self
pub fn set_cpu_usage(&mut self, cpu_usage: T) -> &mut Self
sets the cpu usage and returns a mutable reference to the current instance
Sourcepub fn set_edge_count(&mut self, edge_count: usize) -> &mut Self
pub fn set_edge_count(&mut self, edge_count: usize) -> &mut Self
sets the edge count and returns a mutable reference to the current 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
sets the feature count and returns a mutable reference to the current instance
Sourcepub fn set_learning_nodes(&mut self, learning_nodes: usize) -> &mut Self
pub fn set_learning_nodes(&mut self, learning_nodes: usize) -> &mut Self
sets the learning nodes and returns a mutable reference to the current instance
Sourcepub fn set_memory_usage(&mut self, memory_usage: T) -> &mut Self
pub fn set_memory_usage(&mut self, memory_usage: T) -> &mut Self
sets the memory usage and returns a mutable reference to the current instance
Sourcepub fn set_partition_count(&mut self, partition_count: usize) -> &mut Self
pub fn set_partition_count(&mut self, partition_count: usize) -> &mut Self
sets the partition count and returns a mutable reference to the current instance
Sourcepub fn set_queued_tasks(&mut self, queued_tasks: usize) -> &mut Self
pub fn set_queued_tasks(&mut self, queued_tasks: usize) -> &mut Self
sets the queued tasks and returns a mutable reference to the current instance
Sourcepub fn set_running_tasks(&mut self, running_tasks: usize) -> &mut Self
pub fn set_running_tasks(&mut self, running_tasks: usize) -> &mut Self
sets the running tasks and returns a mutable reference to the current instance
Sourcepub fn set_surface_network_count(
&mut self,
surface_network_count: usize,
) -> &mut Self
pub fn set_surface_network_count( &mut self, surface_network_count: usize, ) -> &mut Self
sets the surface network count and returns a mutable reference to the current instance
Sourcepub fn set_vertex_count(&mut self, vertex_count: usize) -> &mut Self
pub fn set_vertex_count(&mut self, vertex_count: usize) -> &mut Self
sets the vertex count and returns a mutable reference to the current instance
Sourcepub fn with_available_compute(self, compute: usize) -> Self
pub fn with_available_compute(self, compute: usize) -> Self
consumes the current instance to create another with the given available compute
Sourcepub fn with_available_memory(self, memory: usize) -> Self
pub fn with_available_memory(self, memory: usize) -> Self
consumes the current instance to create another with the given available memory
Sourcepub fn with_capabilities<I>(self, iter: I) -> Self
pub fn with_capabilities<I>(self, iter: I) -> Self
consumes the current instance to create another with the given capabilities
Sourcepub fn with_cpu_usage(self, cpu_usage: T) -> Self
pub fn with_cpu_usage(self, cpu_usage: T) -> Self
consumes the current instance to create another with the given cpu usage
Sourcepub fn with_edge_count(self, edge_count: usize) -> Self
pub fn with_edge_count(self, edge_count: usize) -> Self
consumes the current instance to create another with the given edge count
Sourcepub fn with_feature_count(self, feature_count: usize) -> Self
pub fn with_feature_count(self, feature_count: usize) -> Self
consumes the current instance to create another with the given feature count
Sourcepub fn with_learning_nodes(self, learning_nodes: usize) -> Self
pub fn with_learning_nodes(self, learning_nodes: usize) -> Self
consumes the current instance to create another with the given learning nodes
Sourcepub fn with_memory_usage(self, memory_usage: T) -> Self
pub fn with_memory_usage(self, memory_usage: T) -> Self
consumes the current instance to create another with the given memory usage
Sourcepub fn with_partition_count(self, partition_count: usize) -> Self
pub fn with_partition_count(self, partition_count: usize) -> Self
consumes the current instance to create another with the given partition count
Sourcepub fn with_queued_tasks(self, queued_tasks: usize) -> Self
pub fn with_queued_tasks(self, queued_tasks: usize) -> Self
consumes the current instance to create another with the given queued tasks
Sourcepub fn with_running_tasks(self, running_tasks: usize) -> Self
pub fn with_running_tasks(self, running_tasks: usize) -> Self
consumes the current instance to create another with the given running tasks
Sourcepub fn with_surface_network_count(self, surface_network_count: usize) -> Self
pub fn with_surface_network_count(self, surface_network_count: usize) -> Self
consumes the current instance to create another with the given surface network count
Sourcepub fn with_vertex_count(self, vertex_count: usize) -> Self
pub fn with_vertex_count(self, vertex_count: usize) -> Self
consumes the current instance to create another with the given vertex count
Trait Implementations§
Source§impl<T: Clone> Clone for ResourceMetrics<T>
impl<T: Clone> Clone for ResourceMetrics<T>
Source§fn clone(&self) -> ResourceMetrics<T>
fn clone(&self) -> ResourceMetrics<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for ResourceMetrics<T>
impl<T: Debug> Debug for ResourceMetrics<T>
Source§impl<T: Default> Default for ResourceMetrics<T>
impl<T: Default> Default for ResourceMetrics<T>
Source§fn default() -> ResourceMetrics<T>
fn default() -> ResourceMetrics<T>
Source§impl<'de, T> Deserialize<'de> for ResourceMetrics<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ResourceMetrics<T>where
T: Deserialize<'de>,
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<T: PartialEq> PartialEq for ResourceMetrics<T>
impl<T: PartialEq> PartialEq for ResourceMetrics<T>
Source§impl<T> Serialize for ResourceMetrics<T>where
T: Serialize,
impl<T> Serialize for ResourceMetrics<T>where
T: Serialize,
impl<T> StructuralPartialEq for ResourceMetrics<T>
Auto Trait Implementations§
impl<T> Freeze for ResourceMetrics<T>where
T: Freeze,
impl<T> RefUnwindSafe for ResourceMetrics<T>where
T: RefUnwindSafe,
impl<T> Send for ResourceMetrics<T>where
T: Send,
impl<T> Sync for ResourceMetrics<T>where
T: Sync,
impl<T> Unpin for ResourceMetrics<T>where
T: Unpin,
impl<T> UnwindSafe for ResourceMetrics<T>where
T: UnwindSafe,
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<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