#[non_exhaustive]pub struct ScoreSpec { /* private fields */ }Expand description
Native output semantics, shared by scalars and maps. No universal range or normalization is imposed.
Implementations§
Source§impl ScoreSpec
impl ScoreSpec
Sourcepub const fn new(key: &'static str, direction: Direction) -> Self
pub const fn new(key: &'static str, direction: Direction) -> Self
Declare a scalar without an assumed identity value or range.
Sourcepub fn with_key(self, key: impl Into<Cow<'static, str>>) -> Self
pub fn with_key(self, key: impl Into<Cow<'static, str>>) -> Self
Replace the stable identifier, including a name computed at runtime.
Sourcepub const fn positive_infinity(&self) -> bool
pub const fn positive_infinity(&self) -> bool
Whether positive infinity is accepted as a scalar value.
Sourcepub const fn with_positive_infinity(self, allowed: bool) -> Self
pub const fn with_positive_infinity(self, allowed: bool) -> Self
Configure infinity independently of any identical-pair value.
Sourcepub fn with_unit(self, unit: impl Into<Cow<'static, str>>) -> Self
pub fn with_unit(self, unit: impl Into<Cow<'static, str>>) -> Self
Name the native unit or scale.
Sourcepub const fn with_perfect(self, value: f64) -> Self
pub const fn with_perfect(self, value: f64) -> Self
Set the identical-pair value, permitting positive infinity if specified.
§Panics
Panics for NaN or negative infinity, which cannot be valid scores.
Trait Implementations§
impl StructuralPartialEq for ScoreSpec
Auto Trait Implementations§
impl Freeze for ScoreSpec
impl RefUnwindSafe for ScoreSpec
impl Send for ScoreSpec
impl Sync for ScoreSpec
impl Unpin for ScoreSpec
impl UnsafeUnpin for ScoreSpec
impl UnwindSafe for ScoreSpec
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