pub struct Objective(/* private fields */);Expand description
A reliability target, stored as a ratio in the open interval (0, 1).
99.9% availability is Objective::percent(99.9) and reads back as a ratio
of 0.999.
Implementations§
Source§impl Objective
impl Objective
Sourcepub fn percent(p: f64) -> Result<Self>
pub fn percent(p: f64) -> Result<Self>
Build an objective from a percentage in the open interval (0, 100).
Sourcepub fn ratio(r: f64) -> Result<Self>
pub fn ratio(r: f64) -> Result<Self>
Build an objective from a ratio in the open interval (0, 1).
Sourcepub fn as_percent(&self) -> f64
pub fn as_percent(&self) -> f64
The objective as a percentage, e.g. 99.9.
Sourcepub fn error_budget_ratio(&self) -> f64
pub fn error_budget_ratio(&self) -> f64
The error-budget ratio, i.e. 1 - objective.
Trait Implementations§
impl Copy for Objective
impl StructuralPartialEq for Objective
Auto Trait Implementations§
impl Freeze for Objective
impl RefUnwindSafe for Objective
impl Send for Objective
impl Sync for Objective
impl Unpin for Objective
impl UnsafeUnpin for Objective
impl UnwindSafe for Objective
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