#[non_exhaustive]pub enum PolicyError {
#[non_exhaustive] ThresholdOutOfRange {
code: CheckCode,
subject: Option<String>,
value: f64,
},
NoRequirements,
BaselineRequired,
}Expand description
A policy that cannot be evaluated as written.
Raised before any requirement is checked: an unsatisfiable threshold is a configuration mistake, and reporting it as a failed gate would blame the data for it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
#[non_exhaustive]ThresholdOutOfRange
A threshold on the 0..=100 percentage scale fell outside it, or was not a finite number. Quality scores and null percentages are percentages, not 0..1 ratios.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
NoRequirements
The policy states no requirement at all. An empty policy passes every report, which is never what a gate is for.
BaselineRequired
The policy states a rule about change, and was evaluated without a
baseline to measure the change from. Use
QualityPolicy::evaluate_against.
Trait Implementations§
Source§impl Clone for PolicyError
impl Clone for PolicyError
Source§impl Debug for PolicyError
impl Debug for PolicyError
Source§impl Display for PolicyError
impl Display for PolicyError
Source§impl Error for PolicyError
impl Error for PolicyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for PolicyError
impl PartialEq for PolicyError
impl StructuralPartialEq for PolicyError
Auto Trait Implementations§
impl Freeze for PolicyError
impl RefUnwindSafe for PolicyError
impl Send for PolicyError
impl Sync for PolicyError
impl Unpin for PolicyError
impl UnsafeUnpin for PolicyError
impl UnwindSafe for PolicyError
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