pub trait TimeRepresentation:
TimeMode
+ Clone
+ Send
+ Default
+ CondSerialize
+ CondDeserialize
+ 'static {
type InnerTime: Debug + Clone + Send + CondSerialize + CondDeserialize;
// Required methods
fn convert_from(&mut self, inner: Self::InnerTime) -> Time;
fn convert_into(&self, ts: Time) -> Self::InnerTime;
fn to_string(&self, ts: Self::InnerTime) -> String;
fn parse(s: &str) -> Result<Self::InnerTime, String>;
// Provided methods
fn default_start_time() -> Option<SystemTime> { ... }
fn init_start_time(
&mut self,
start: Option<SystemTime>,
) -> Arc<RwLock<Option<SystemTime>>> { ... }
fn set_start_time(&mut self, _start_time: Arc<RwLock<Option<SystemTime>>>) { ... }
}
Expand description
The functionality a time format has to provide.
Required Associated Types§
Sourcetype InnerTime: Debug + Clone + Send + CondSerialize + CondDeserialize
type InnerTime: Debug + Clone + Send + CondSerialize + CondDeserialize
The internal representation of the time format.
Required Methods§
Sourcefn convert_from(&mut self, inner: Self::InnerTime) -> Time
fn convert_from(&mut self, inner: Self::InnerTime) -> Time
Convert from the internal time representation to the monitor time.
Sourcefn convert_into(&self, ts: Time) -> Self::InnerTime
fn convert_into(&self, ts: Time) -> Self::InnerTime
Convert from monitor time to the internal representation.
Provided Methods§
Sourcefn default_start_time() -> Option<SystemTime>
fn default_start_time() -> Option<SystemTime>
Returns a default start time if applicable for the time representation.
Sourcefn init_start_time(
&mut self,
start: Option<SystemTime>,
) -> Arc<RwLock<Option<SystemTime>>>
fn init_start_time( &mut self, start: Option<SystemTime>, ) -> Arc<RwLock<Option<SystemTime>>>
Initializes the start time of the time representation.
Sourcefn set_start_time(&mut self, _start_time: Arc<RwLock<Option<SystemTime>>>)
fn set_start_time(&mut self, _start_time: Arc<RwLock<Option<SystemTime>>>)
Set an already initialized start time.
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.