Trait web_time::web::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§
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.
Object Safety§
This trait is not object safe.