pub struct SlidingWindowChecker { /* private fields */ }Expand description
Collection of sliding window constraints
Implementations§
Source§impl SlidingWindowChecker
impl SlidingWindowChecker
Sourcepub fn add(&mut self, constraint: SlidingWindowConstraint)
pub fn add(&mut self, constraint: SlidingWindowConstraint)
Add a constraint
Sourcepub fn push_and_check(&mut self, value: f32) -> Vec<(String, bool, f32)>
pub fn push_and_check(&mut self, value: f32) -> Vec<(String, bool, f32)>
Push a value and check all constraints
Sourcepub fn total_violation(&self) -> f32
pub fn total_violation(&self) -> f32
Total weighted violation
Sourcepub fn all_satisfied(&self) -> bool
pub fn all_satisfied(&self) -> bool
Check if all constraints are satisfied
Trait Implementations§
Source§impl Debug for SlidingWindowChecker
impl Debug for SlidingWindowChecker
Source§impl Default for SlidingWindowChecker
impl Default for SlidingWindowChecker
Source§fn default() -> SlidingWindowChecker
fn default() -> SlidingWindowChecker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SlidingWindowChecker
impl RefUnwindSafe for SlidingWindowChecker
impl Send for SlidingWindowChecker
impl Sync for SlidingWindowChecker
impl Unpin for SlidingWindowChecker
impl UnwindSafe for SlidingWindowChecker
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more