Skip to main content

TimeSource

Trait TimeSource 

Source
pub trait TimeSource: 'static {
    // Required methods
    fn system_time(&mut self) -> Result<SystemTime, HostFailure>;
    fn local_offset_seconds(&mut self) -> Result<i32, HostFailure>;
}
Expand description

A caller-owned source for official Gleam wall-clock operations.

Required Methods§

Source

fn system_time(&mut self) -> Result<SystemTime, HostFailure>

Returns the current wall-clock time.

Source

fn local_offset_seconds(&mut self) -> Result<i32, HostFailure>

Returns the current local offset from UTC in seconds.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§