pub struct TimeThreshold {
pub warn: Duration,
pub critical: Duration,
}
Expand description
Structure denoting time limits for test execution.
From https://github.com/rust-lang/rust/blob/master/library/test/src/time.rs
Fields§
§warn: Duration
§critical: Duration
Implementations§
Source§impl TimeThreshold
impl TimeThreshold
Sourcepub fn new(warn: Duration, critical: Duration) -> Self
pub fn new(warn: Duration, critical: Duration) -> Self
Creates a new TimeThreshold
instance with provided durations.
Sourcepub fn from_env_var(env_var_name: &str) -> Option<Self>
pub fn from_env_var(env_var_name: &str) -> Option<Self>
Attempts to create a TimeThreshold
instance with values obtained
from the environment variable, and returns None
if the variable
is not set.
Environment variable format is expected to match \d+,\d+
.
§Panics
Panics if variable with provided name is set but contains inappropriate value.
pub fn is_critical(&self, duration: &Duration) -> bool
pub fn is_warn(&self, duration: &Duration) -> bool
Trait Implementations§
Source§impl Clone for TimeThreshold
impl Clone for TimeThreshold
Source§fn clone(&self) -> TimeThreshold
fn clone(&self) -> TimeThreshold
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 TimeThreshold
impl Debug for TimeThreshold
Source§impl Default for TimeThreshold
impl Default for TimeThreshold
Source§fn default() -> TimeThreshold
fn default() -> TimeThreshold
Returns the “default value” for a type. Read more
Source§impl PartialEq for TimeThreshold
impl PartialEq for TimeThreshold
impl Copy for TimeThreshold
impl Eq for TimeThreshold
impl StructuralPartialEq for TimeThreshold
Auto Trait Implementations§
impl Freeze for TimeThreshold
impl RefUnwindSafe for TimeThreshold
impl Send for TimeThreshold
impl Sync for TimeThreshold
impl Unpin for TimeThreshold
impl UnwindSafe for TimeThreshold
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