pub enum TimeSource {
System,
Test(DateTime<Utc>),
TestNow,
}Expand description
Time source configuration for different environments
Variants§
System
Use system time (production)
Test(DateTime<Utc>)
Use test time with initial timestamp
TestNow
Use test time starting at current system time
Implementations§
Source§impl TimeSource
impl TimeSource
Sourcepub fn from_env() -> TimeSource
pub fn from_env() -> TimeSource
Create from environment variables
- TIME_SOURCE: “system” (default) or “test”
- TIME_START: RFC3339 timestamp for test mode start time
Sourcepub fn into_provider(self) -> Arc<dyn TimeProvider>
pub fn into_provider(self) -> Arc<dyn TimeProvider>
Convert to a time provider instance
Trait Implementations§
Source§impl Clone for TimeSource
impl Clone for TimeSource
Source§fn clone(&self) -> TimeSource
fn clone(&self) -> TimeSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TimeSource
impl Debug for TimeSource
Source§impl Default for TimeSource
impl Default for TimeSource
Source§fn default() -> TimeSource
fn default() -> TimeSource
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TimeSource
impl RefUnwindSafe for TimeSource
impl Send for TimeSource
impl Sync for TimeSource
impl Unpin for TimeSource
impl UnsafeUnpin for TimeSource
impl UnwindSafe for TimeSource
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