Skip to main content

FormatForScale

Trait FormatForScale 

Source
pub trait FormatForScale<S: Scale>: TimeFormat + Sealed {
    // Required methods
    fn try_from_time<Fin: TimeFormat>(
        time: Time<S, Fin>,
        ctx: &TimeContext,
    ) -> Result<Quantity<Self::Unit>, ConversionError>;
    fn try_into_time(
        raw: Quantity<Self::Unit>,
        ctx: &TimeContext,
    ) -> Result<Time<S, Self>, ConversionError>
       where Self: Sized;
}
Expand description

Witness that format F can encode and decode instants on scale S.

Required Methods§

Source

fn try_from_time<Fin: TimeFormat>( time: Time<S, Fin>, ctx: &TimeContext, ) -> Result<Quantity<Self::Unit>, ConversionError>

Source

fn try_into_time( raw: Quantity<Self::Unit>, ctx: &TimeContext, ) -> Result<Time<S, Self>, ConversionError>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§