ResourceMetrics

Struct ResourceMetrics 

Source
pub struct ResourceMetrics<T = f32> { /* private fields */ }
Expand description

Resource metrics for a node

Implementations§

Source§

impl<T> ResourceMetrics<T>

Source

pub fn new() -> Self
where T: Default,

Source

pub const fn capabilities(&self) -> &Vec<String>

returns an immutable reference to the runtimes capabilities

Source

pub const fn capabilities_mut(&mut self) -> &mut Vec<String>

returns a mutable reference to the runtimes capabilities

Source

pub const fn available_compute(&self) -> usize

returns a copy of the available compute

Source

pub const fn available_compute_mut(&mut self) -> &mut usize

returns a mutable reference to the available compute

Source

pub const fn available_memory(&self) -> usize

returns a copy of the available memory

Source

pub const fn available_memory_mut(&mut self) -> &mut usize

returns a mutable reference to the available memory

Source

pub const fn cpu_usage(&self) -> &T

returns a copy of the cpu usage

Source

pub const fn cpu_usage_mut(&mut self) -> &mut T

returns a mutable reference to the cpu usage

Source

pub const fn edge_count(&self) -> usize

returns a copy of the edge count

Source

pub const fn edge_count_mut(&mut self) -> &mut usize

returns a mutable reference to the edge count

Source

pub const fn feature_count(&self) -> usize

returns a copy of the feature count

Source

pub const fn feature_count_mut(&mut self) -> &mut usize

returns a mutable reference to the feature count

Source

pub const fn learning_nodes(&self) -> usize

returns a copy of the learning nodes

Source

pub const fn learning_nodes_mut(&mut self) -> &mut usize

returns a mutable reference to the learning nodes

Source

pub const fn memory_usage(&self) -> &T

returns a copy of the memory usage

Source

pub const fn memory_usage_mut(&mut self) -> &mut T

returns a mutable reference to the memory usage

Source

pub const fn partition_count(&self) -> usize

returns a copy of the partition count

Source

pub const fn partition_count_mut(&mut self) -> &mut usize

returns a mutable reference to the partition count

Source

pub const fn queued_tasks(&self) -> usize

returns a copy of the queued tasks

Source

pub const fn queued_tasks_mut(&mut self) -> &mut usize

returns a mutable reference to the queued tasks

Source

pub const fn running_tasks(&self) -> usize

returns a copy of the running tasks

Source

pub const fn running_tasks_mut(&mut self) -> &mut usize

returns a mutable reference to the running tasks

Source

pub const fn surface_network_count(&self) -> usize

returns a copy of the surface network count

Source

pub const fn surface_network_count_mut(&mut self) -> &mut usize

returns a mutable reference to the surface network count

Source

pub const fn vertex_count(&self) -> usize

returns a copy of the vertex count

Source

pub const fn vertex_count_mut(&mut self) -> &mut usize

returns a mutable reference to the vertex count

Source

pub fn set_available_compute(&mut self, compute: usize) -> &mut Self

updates the availible compute and returns a mutable reference to the current instance

Source

pub fn set_available_memory(&mut self, memory: usize) -> &mut Self

updates the available memory and returns a mutable reference to the current instance

Source

pub fn set_capabilities<I>(&mut self, iter: I) -> &mut Self
where I: IntoIterator, I::Item: ToString,

sets the runtimes capabilities

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn with_available_compute(self, compute: usize) -> Self

consumes the current instance to create another with the given available compute

Source

pub fn with_available_memory(self, memory: usize) -> Self

consumes the current instance to create another with the given available memory

Source

pub fn with_capabilities<I>(self, iter: I) -> Self
where I: IntoIterator, I::Item: ToString,

consumes the current instance to create another with the given capabilities

Source

pub fn with_cpu_usage(self, cpu_usage: T) -> Self

consumes the current instance to create another with the given cpu usage

Source

pub fn with_edge_count(self, edge_count: usize) -> Self

consumes the current instance to create another with the given edge count

Source

pub fn with_feature_count(self, feature_count: usize) -> Self

consumes the current instance to create another with the given feature count

Source

pub fn with_learning_nodes(self, learning_nodes: usize) -> Self

consumes the current instance to create another with the given learning nodes

Source

pub fn with_memory_usage(self, memory_usage: T) -> Self

consumes the current instance to create another with the given memory usage

Source

pub fn with_partition_count(self, partition_count: usize) -> Self

consumes the current instance to create another with the given partition count

Source

pub fn with_queued_tasks(self, queued_tasks: usize) -> Self

consumes the current instance to create another with the given queued tasks

Source

pub fn with_running_tasks(self, running_tasks: usize) -> Self

consumes the current instance to create another with the given running tasks

Source

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

Source

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>

Source§

fn clone(&self) -> ResourceMetrics<T>

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<T: Debug> Debug for ResourceMetrics<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default> Default for ResourceMetrics<T>

Source§

fn default() -> ResourceMetrics<T>

Returns the “default value” for a type. Read more
Source§

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>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T: PartialEq> PartialEq for ResourceMetrics<T>

Source§

fn eq(&self, other: &ResourceMetrics<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> Serialize for ResourceMetrics<T>
where T: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsWeight<T> for T
where T: Clone + IntoWeight<T>,

Source§

fn as_weight(&self) -> Weight<T>

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<K, S> Identity<K> for S
where S: Borrow<K>, K: Identifier,

Source§

type Item = S

Source§

fn get(&self) -> &<S as Identity<K>>::Item

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoWeight<T> for T

Source§

impl<A, B, C> PercentDifference<B> for A
where A: Clone, B: Sub<A, Output = C>, C: Div<A, Output = C>,

Source§

type Output = C

Source§

fn percent_diff(self, rhs: B) -> <A as PercentDifference<B>>::Output

Computes the percent difference between two values.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<Q> RawState for Q
where Q: Send + Sync + Debug,

Source§

fn __private__(&self) -> Seal

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,