Skip to main content

MetricId

Struct MetricId 

Source
#[non_exhaustive]
pub struct MetricId { /* private fields */ }
Expand description

Full identity of one configured metric instance. See the crate documentation.

Implementations§

Source§

impl MetricId

Source

pub fn new(family: &'static str, implementation: Implementation) -> Self

family ("fsim") as computed by implementation.

Source

pub fn with_variant(self, variant: &'static str) -> Self

Set the variant within the family ("vifvec", "v3").

Source

pub fn with_reference(self, reference: impl Into<Cow<'static, str>>) -> Self

Name the published reference this implementation reproduces ("pycvvdp 0.5.7", "MATLAB FeatureSIM.m (Zhang 2011)").

Source

pub fn with_backend(self, backend: Backend) -> Self

Replace the backend.

Source

pub fn with_config( self, key: impl Into<Cow<'static, str>>, value: impl Display, ) -> Self

Record one configuration knob. Values render through Display (Rust prints floats as their shortest round-trip form, so 0.5 stays 0.5). Setting a key twice keeps the last value. Keys stay sorted, so insertion order never changes the fingerprint.

Source

pub fn family(&self) -> &'static str

The metric family.

Source

pub fn variant(&self) -> Option<&'static str>

The variant, if any.

Source

pub fn reference(&self) -> &str

The reproduced reference (empty when unset).

Source

pub fn implementation(&self) -> &Implementation

The implementation.

Source

pub fn config(&self) -> &[(Cow<'static, str>, Cow<'static, str>)]

Configuration knobs, sorted by key.

Source

pub fn config_value(&self, key: &str) -> Option<&str>

One configuration value.

Trait Implementations§

Source§

impl Clone for MetricId

Source§

fn clone(&self) -> MetricId

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MetricId

Source§

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

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

impl Display for MetricId

Source§

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

family[/variant] (crate@version r{rev} {backend}).

Source§

impl Eq for MetricId

Source§

impl Hash for MetricId

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MetricId

Source§

fn eq(&self, other: &MetricId) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MetricId

Auto Trait Implementations§

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> 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<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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.