Struct aws_smithy_async::test_util::InstantSleep
source · pub struct InstantSleep { /* private fields */ }
Available on crate feature
test-util
only.Expand description
A sleep implementation where calls to AsyncSleep::sleep
will complete instantly.
Create a InstantSleep
with instant_time_and_sleep
Implementations§
source§impl InstantSleep
impl InstantSleep
sourcepub fn new(log: Arc<Mutex<Vec<Duration>>>) -> Self
pub fn new(log: Arc<Mutex<Vec<Duration>>>) -> Self
Given a shared log for sleep durations, create a new InstantSleep
.
sourcepub fn logs(&self) -> Vec<Duration>
pub fn logs(&self) -> Vec<Duration>
Return the sleep durations that were logged by this InstantSleep
.
sourcepub fn total_duration(&self) -> Duration
pub fn total_duration(&self) -> Duration
Return the total sleep duration that was logged by this InstantSleep
.
Trait Implementations§
source§impl AsyncSleep for InstantSleep
impl AsyncSleep for InstantSleep
source§impl Clone for InstantSleep
impl Clone for InstantSleep
source§fn clone(&self) -> InstantSleep
fn clone(&self) -> InstantSleep
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 moreAuto Trait Implementations§
impl Freeze for InstantSleep
impl RefUnwindSafe for InstantSleep
impl Send for InstantSleep
impl Sync for InstantSleep
impl Unpin for InstantSleep
impl UnwindSafe for InstantSleep
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