FromTimeScale

Trait FromTimeScale 

Source
pub trait FromTimeScale<Scale: ?Sized> {
    // Required method
    fn from_time_scale(time_point: TimePoint<Scale>) -> Self;
}
Expand description

Trait representing the ability to convert from one scale into another. Note that this conversion must always succeed: barring arithmetic overflows (on which panics are advised), it must always be possible to relate the time of two scales.

Note that this trait must be implemented on a given TimePoint. The converse trait, IntoScale, may be derived automatically. Just like with From and Into, it is advised to simply implement FromScale and let IntoScale be derived.

Required Methods§

Source

fn from_time_scale(time_point: TimePoint<Scale>) -> Self

Constructs a time point from an instant expressed in another scale.

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§

Source§

impl FromTimeScale<Tcb> for TdbTime

Source§

impl FromTimeScale<Tcg> for TtTime

Source§

impl FromTimeScale<Tdb> for TcbTime

Source§

impl FromTimeScale<Tt> for TcgTime

Source§

impl<ScaleFrom, ScaleInto> FromTimeScale<ScaleFrom> for TimePoint<ScaleInto>
where ScaleFrom: TerrestrialTime, ScaleInto: TerrestrialTime,