pub struct Confidence(/* private fields */);Expand description
Confidence score in the range [0.0, 1.0].
Values outside the range (including NaN and infinities) are rejected
at construction time. Below a configurable threshold this triggers
Human-in-the-Loop confirmation.
use orcs_types::intent::Confidence;
assert!(Confidence::new(0.95).is_some());
assert!(Confidence::new(-0.1).is_none());
assert!(Confidence::new(1.1).is_none());
assert!(Confidence::new(f64::NAN).is_none());Implementations§
Trait Implementations§
Source§impl Clone for Confidence
impl Clone for Confidence
Source§fn clone(&self) -> Confidence
fn clone(&self) -> Confidence
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Confidence
impl Debug for Confidence
Source§impl<'de> Deserialize<'de> for Confidence
impl<'de> Deserialize<'de> for Confidence
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Confidence
impl Display for Confidence
Source§impl PartialEq for Confidence
impl PartialEq for Confidence
Source§impl PartialOrd for Confidence
impl PartialOrd for Confidence
Source§impl Serialize for Confidence
impl Serialize for Confidence
impl Copy for Confidence
impl StructuralPartialEq for Confidence
Auto Trait Implementations§
impl Freeze for Confidence
impl RefUnwindSafe for Confidence
impl Send for Confidence
impl Sync for Confidence
impl Unpin for Confidence
impl UnsafeUnpin for Confidence
impl UnwindSafe for Confidence
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