pub struct GateConfig {
pub min_pass_rate: Option<f64>,
pub max_cost: Option<f64>,
pub max_duration: Option<Duration>,
}Expand description
Configuration for CI/CD gate checks against evaluation results.
Serde-ready so consumers (notably the swink-eval gate subcommand)
can load thresholds from a YAML/JSON file without re-declaring the
shape.
Fields§
§min_pass_rate: Option<f64>Minimum fraction of cases that must pass (e.g. 0.95 for 95%).
max_cost: Option<f64>Maximum total cost in dollars.
max_duration: Option<Duration>Maximum total wall-clock duration.
Implementations§
Source§impl GateConfig
impl GateConfig
Sourcepub fn with_min_pass_rate(self, rate: f64) -> Self
pub fn with_min_pass_rate(self, rate: f64) -> Self
Set the minimum pass rate threshold.
Sourcepub fn with_max_cost(self, cost: f64) -> Self
pub fn with_max_cost(self, cost: f64) -> Self
Set the maximum allowed cost in dollars.
Sourcepub const fn with_max_duration(self, duration: Duration) -> Self
pub const fn with_max_duration(self, duration: Duration) -> Self
Set the maximum allowed wall-clock duration.
Trait Implementations§
Source§impl Clone for GateConfig
impl Clone for GateConfig
Source§fn clone(&self) -> GateConfig
fn clone(&self) -> GateConfig
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 GateConfig
impl Debug for GateConfig
Source§impl Default for GateConfig
impl Default for GateConfig
Source§fn default() -> GateConfig
fn default() -> GateConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GateConfig
impl<'de> Deserialize<'de> for GateConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GateConfig
impl RefUnwindSafe for GateConfig
impl Send for GateConfig
impl Sync for GateConfig
impl Unpin for GateConfig
impl UnsafeUnpin for GateConfig
impl UnwindSafe for GateConfig
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