pub struct SafetyScore(/* private fields */);Expand description
Risk score in milli-units, 0 (safe) ..= 1000 (max). Integer for
deterministic, float-free safety decisions (ADR-008).
Implementations§
Source§impl SafetyScore
impl SafetyScore
pub const SAFE: SafetyScore
pub const MAX: SafetyScore
Sourcepub fn from_milli(milli: u16) -> SafetyScore
pub fn from_milli(milli: u16) -> SafetyScore
Clamp a milli-unit value into [0, 1000].
Trait Implementations§
Source§impl Clone for SafetyScore
impl Clone for SafetyScore
Source§fn clone(&self) -> SafetyScore
fn clone(&self) -> SafetyScore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SafetyScore
Source§impl Debug for SafetyScore
impl Debug for SafetyScore
Source§impl Default for SafetyScore
impl Default for SafetyScore
Source§fn default() -> SafetyScore
fn default() -> SafetyScore
Returns the “default value” for a type. Read more
impl Eq for SafetyScore
Source§impl Ord for SafetyScore
impl Ord for SafetyScore
Source§fn cmp(&self, other: &SafetyScore) -> Ordering
fn cmp(&self, other: &SafetyScore) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SafetyScore
impl PartialEq for SafetyScore
Source§fn eq(&self, other: &SafetyScore) -> bool
fn eq(&self, other: &SafetyScore) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SafetyScore
impl PartialOrd for SafetyScore
impl StructuralPartialEq for SafetyScore
Auto Trait Implementations§
impl Freeze for SafetyScore
impl RefUnwindSafe for SafetyScore
impl Send for SafetyScore
impl Sync for SafetyScore
impl Unpin for SafetyScore
impl UnsafeUnpin for SafetyScore
impl UnwindSafe for SafetyScore
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