Trait FromToTomlDateTime

Source
pub trait FromToTomlDateTime: Sized {
    // Required methods
    fn from_toml(value: TomlDatetime) -> Result<Self, Error>;
    fn to_toml(&self) -> Result<TomlDatetime, Error>;
}
Expand description

Trait that allows easy conversion between TomlDatetime and chrono’s/time’s types

Required Methods§

Source

fn from_toml(value: TomlDatetime) -> Result<Self, Error>

Converts from a TomlDatetime

§Errors

Fails when the TomlDatetime contains data not representable by Self or is missing data required by Self

Source

fn to_toml(&self) -> Result<TomlDatetime, Error>

Converts to a TomlDatetime

§Errors

Fails when the Self is not representable by TomlDatetime mainly due to a negative year

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.

Implementations on Foreign Types§

Source§

impl FromToTomlDateTime for DateTime<FixedOffset>

Source§

impl FromToTomlDateTime for DateTime<Utc>

Source§

impl FromToTomlDateTime for NaiveDate

Source§

impl FromToTomlDateTime for NaiveDateTime

Source§

impl FromToTomlDateTime for NaiveTime

Source§

impl FromToTomlDateTime for Date

Source§

impl FromToTomlDateTime for OffsetDateTime

Source§

impl FromToTomlDateTime for PrimitiveDateTime

Source§

impl FromToTomlDateTime for Time

Implementors§