pub trait SystemTimeExt {
// Required methods
fn to_std(self) -> SystemTime;
fn from_std(time: SystemTime) -> SystemTime;
}
Web
and crate feature std
only.Expand description
Web-specific extension to web_time::SystemTime
.
Required Methods§
Sourcefn to_std(self) -> SystemTime
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.
Sourcefn from_std(time: SystemTime) -> SystemTime
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.