Struct aws_smithy_async::test_util::ManualTimeSource
source · pub struct ManualTimeSource { /* private fields */ }
Available on crate feature
test-util
only.Expand description
Manually controlled time source
Implementations§
source§impl ManualTimeSource
impl ManualTimeSource
sourcepub fn seconds_since_unix_epoch(&self) -> f64
pub fn seconds_since_unix_epoch(&self) -> f64
Get the number of seconds since the UNIX Epoch as an f64.
§Panics
This will panic if self.now()
returns a time that’s before the UNIX Epoch.
sourcepub fn new(start_time: SystemTime) -> ManualTimeSource
pub fn new(start_time: SystemTime) -> ManualTimeSource
Creates a new ManualTimeSource
sourcepub fn advance(&self, duration: Duration) -> SystemTime
pub fn advance(&self, duration: Duration) -> SystemTime
Advances the time of this time source by duration
.
sourcepub fn set_time(&self, time: SystemTime)
pub fn set_time(&self, time: SystemTime)
Trait Implementations§
source§impl Clone for ManualTimeSource
impl Clone for ManualTimeSource
source§fn clone(&self) -> ManualTimeSource
fn clone(&self) -> ManualTimeSource
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 ManualTimeSource
impl Debug for ManualTimeSource
source§fn from(value: ManualTimeSource) -> Self
fn from(value: ManualTimeSource) -> Self
Converts to this type from the input type.
source§impl TimeSource for ManualTimeSource
impl TimeSource for ManualTimeSource
source§fn now(&self) -> SystemTime
fn now(&self) -> SystemTime
Returns the current time
Auto Trait Implementations§
impl Freeze for ManualTimeSource
impl RefUnwindSafe for ManualTimeSource
impl Send for ManualTimeSource
impl Sync for ManualTimeSource
impl Unpin for ManualTimeSource
impl UnwindSafe for ManualTimeSource
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)