pub trait DateTime: Sized {
// Required methods
fn date_part(
&self,
ty: FieldType,
unit: DateUnit,
) -> Result<Option<f64>, DateTimeError>;
fn is_finite(&self) -> bool;
fn truncate(
&self,
ty: FieldType,
unit: DateUnit,
) -> Result<Self, DateTimeError>;
// Provided method
fn is_infinite(&self) -> bool { ... }
}Expand description
General trait for all date time types.
Required Methods§
Provided Methods§
Sourcefn is_infinite(&self) -> bool
fn is_infinite(&self) -> bool
Checks whether date time is infinite.
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.