#[non_exhaustive]pub struct MetricId { /* private fields */ }Expand description
Full identity of one configured metric instance. See the crate documentation.
Implementations§
Source§impl MetricId
impl MetricId
Sourcepub fn new(family: &'static str, implementation: Implementation) -> Self
pub fn new(family: &'static str, implementation: Implementation) -> Self
family ("fsim") as computed by implementation.
Sourcepub fn with_variant(self, variant: &'static str) -> Self
pub fn with_variant(self, variant: &'static str) -> Self
Set the variant within the family ("vifvec", "v3").
Sourcepub fn with_reference(self, reference: impl Into<Cow<'static, str>>) -> Self
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)").
Sourcepub fn with_backend(self, backend: Backend) -> Self
pub fn with_backend(self, backend: Backend) -> Self
Replace the backend.
Sourcepub fn with_config(
self,
key: impl Into<Cow<'static, str>>,
value: impl Display,
) -> Self
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.
Sourcepub fn implementation(&self) -> &Implementation
pub fn implementation(&self) -> &Implementation
The implementation.
Sourcepub fn config(&self) -> &[(Cow<'static, str>, Cow<'static, str>)]
pub fn config(&self) -> &[(Cow<'static, str>, Cow<'static, str>)]
Configuration knobs, sorted by key.
Sourcepub fn config_value(&self, key: &str) -> Option<&str>
pub fn config_value(&self, key: &str) -> Option<&str>
One configuration value.
Trait Implementations§
impl Eq for MetricId
impl StructuralPartialEq for MetricId
Auto Trait Implementations§
impl Freeze for MetricId
impl RefUnwindSafe for MetricId
impl Send for MetricId
impl Sync for MetricId
impl Unpin for MetricId
impl UnsafeUnpin for MetricId
impl UnwindSafe for MetricId
Blanket Implementations§
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
Mutably borrows from an owned value. Read more