pub trait TimeResolution: Debug + Send + Sync {
    type Representation: Variable + Serialize + for<'de> Deserialize<'de> + for<'k> Key<'k> + Display + Hash + Eq + PartialEq + Ord + PartialOrd + Clone + Copy + Send + Sync + Debug + Default;

    const FORMAT_SUFFIX: &'static str;

    // Required methods
    fn repr_to_duration(
        value: Self::Representation
    ) -> Result<SignedDuration, TimeError>;
    fn duration_to_repr(
        duration: SignedDuration
    ) -> Result<Self::Representation, TimeError>;
}
Expand description

A resolution of a time measurement.

Required Associated Types§

source

type Representation: Variable + Serialize + for<'de> Deserialize<'de> + for<'k> Key<'k> + Display + Hash + Eq + PartialEq + Ord + PartialOrd + Clone + Copy + Send + Sync + Debug + Default

The in-memory and serialized representation for this resolution.

Required Associated Constants§

source

const FORMAT_SUFFIX: &'static str

The label used when formatting times with this resolution.

Required Methods§

Implementors§