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§
Sourcefn from_toml(value: TomlDatetime) -> Result<Self, Error>
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
Sourcefn to_toml(&self) -> Result<TomlDatetime, Error>
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.