Skip to navigation

Struct Resource Measurement

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub struct ResourceMeasurement<T, U>where
    U: ResourceUnit,{
    pub value: T,
    pub unit: U,
}

One available resource measurement.

Fields

value: T

Acquired value. The containing category field is None when unavailable.

unit: U

Unit for the acquired value.

Implementations

impl<T, U> ResourceMeasurement<T, U>where U: ResourceUnit,

impl<T, U> ResourceMeasurement<T, U>where
    U: ResourceUnit,

new

pub fn new(value: impl Into<T>, unit: U) -> ResourceMeasurement<T, U>

Construct an available measurement.

Trait Implementations

impl<T, U> Clone for ResourceMeasurement<T, U>where T: Clone, U: Clone + ResourceUnit,

impl<T, U> Clone for ResourceMeasurement<T, U>where
    T: Clone,
    U: Clone + ResourceUnit,

clone

fn clone(&self) -> ResourceMeasurement<T, U>

clone_from

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

impl<T, U> Debug for ResourceMeasurement<T, U>where T: Debug, U: Debug + ResourceUnit,

impl<T, U> Debug for ResourceMeasurement<T, U>where
    T: Debug,
    U: Debug + ResourceUnit,

fmt

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

impl<'de, T, U> Deserialize<'de> for ResourceMeasurement<T, U>where U: ResourceUnit + Deserialize<'de>, T: Deserialize<'de>,

impl<'de, T, U> Deserialize<'de> for ResourceMeasurement<T, U>where
    U: ResourceUnit + Deserialize<'de>,
    T: Deserialize<'de>,

deserialize

fn deserialize<__D>(
    __deserializer: __D,
) -> Result<ResourceMeasurement<T, U>, <__D as Deserializer<'de>>::Error>where
    __D: Deserializer<'de>,

impl<T, U> PartialEq for ResourceMeasurement<T, U>where T: PartialEq, U: PartialEq + ResourceUnit,

impl<T, U> PartialEq for ResourceMeasurement<T, U>where
    T: PartialEq,
    U: PartialEq + ResourceUnit,

eq

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

ne

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

impl<T, U> Serialize for ResourceMeasurement<T, U>where U: ResourceUnit + Serialize, T: Serialize,

impl<T, U> Serialize for ResourceMeasurement<T, U>where
    U: ResourceUnit + Serialize,
    T: Serialize,

serialize

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

impl<T, U> StructuralPartialEq for ResourceMeasurement<T, U>where U: ResourceUnit,

impl<T, U> StructuralPartialEq for ResourceMeasurement<T, U>where
    U: ResourceUnit,