Skip to navigation

Generated from cargo doc --no-deps -p nemo-relay -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: 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: ResourceUnit> ResourceMeasurement<T, U>

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

new

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

Construct an available measurement.

Trait Implementations

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

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

clone

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

clone_from

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

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

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

fmt

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

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

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

deserialize

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,

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

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

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 T: Serialize, U: Serialize + ResourceUnit,

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

serialize

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

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

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