Struct test::time::TimeThreshold
source · pub struct TimeThreshold {
pub warn: Duration,
pub critical: Duration,
}
🔬This is a nightly-only experimental API. (
test
)Expand description
Structure denoting time limits for test execution.
Fields§
§warn: Duration
🔬This is a nightly-only experimental API. (
§test
)critical: Duration
🔬This is a nightly-only experimental API. (
test
)Implementations§
source§impl TimeThreshold
impl TimeThreshold
sourcepub fn new(warn: Duration, critical: Duration) -> Self
🔬This is a nightly-only experimental API. (test
)
pub fn new(warn: Duration, critical: Duration) -> Self
test
)Creates a new TimeThreshold
instance with provided durations.
sourcepub fn from_env_var(env_var_name: &str) -> Option<Self>
🔬This is a nightly-only experimental API. (test
)
pub fn from_env_var(env_var_name: &str) -> Option<Self>
test
)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.
Trait Implementations§
source§impl Clone for TimeThreshold
impl Clone for TimeThreshold
source§fn clone(&self) -> TimeThreshold
fn clone(&self) -> TimeThreshold
Returns a copy 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 Eq for TimeThreshold
impl Eq for TimeThreshold
fn assert_receiver_is_total_eq(&self)
source§impl PartialEq<TimeThreshold> for TimeThreshold
impl PartialEq<TimeThreshold> for TimeThreshold
source§fn eq(&self, other: &TimeThreshold) -> bool
fn eq(&self, other: &TimeThreshold) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for TimeThreshold
impl StructuralEq for TimeThreshold
impl StructuralPartialEq for TimeThreshold
Auto Trait Implementations§
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