web_time::web

Trait SystemTimeExt

Source
pub trait SystemTimeExt {
    // Required methods
    fn to_std(self) -> SystemTime;
    fn from_std(time: SystemTime) -> SystemTime;
}
Available on Web only.
Expand description

Web-specific extension to web_time::SystemTime.

Required Methods§

Source

fn to_std(self) -> SystemTime

Convert web_time::SystemTime to std::time::SystemTime.

§Note

This might give a misleading impression of compatibility!

Considering this functionality will probably be used to interact with incompatible APIs of other dependencies, care should be taken that the dependency in question doesn’t call std::time::SystemTime::now() internally, which would panic.

Source

fn from_std(time: SystemTime) -> SystemTime

Convert std::time::SystemTime to web_time::SystemTime.

§Note

This might give a misleading impression of compatibility!

Considering this functionality will probably be used to interact with incompatible APIs of other dependencies, care should be taken that the dependency in question doesn’t call std::time::SystemTime::now() internally, which would panic.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§