#[non_exhaustive]pub struct DateConversionConfig {
pub enabled: bool,
pub normalize_to_utc: bool,
pub assume_utc_for_naive: bool,
}Expand description
Configuration for date/datetime string detection and UTC normalization, used by
TypeConversionConfig.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolEnable date/datetime detection and conversion
normalize_to_utc: boolNormalize recognized dates/datetimes to UTC (default: true). When false, a value recognized as a date/datetime is left byte-for-byte unchanged, but is still protected from being misinterpreted as a number by the numbers category.
assume_utc_for_naive: boolFor naive datetimes with no timezone info (e.g. "2024-01-15T10:30:00"),
assume UTC and append Z (default: true). When false, naive datetimes are
left as-is (still protected from number parsing, but not rewritten) since
their true offset is unknown.
Implementations§
Source§impl DateConversionConfig
impl DateConversionConfig
Sourcepub fn normalize_to_utc(self, enabled: bool) -> Self
pub fn normalize_to_utc(self, enabled: bool) -> Self
Configure UTC normalization of recognized dates/datetimes
Sourcepub fn assume_utc_for_naive(self, enabled: bool) -> Self
pub fn assume_utc_for_naive(self, enabled: bool) -> Self
Configure whether naive (timezone-less) datetimes are assumed to be UTC
Trait Implementations§
Source§impl Clone for DateConversionConfig
impl Clone for DateConversionConfig
Source§fn clone(&self) -> DateConversionConfig
fn clone(&self) -> DateConversionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DateConversionConfig
impl Debug for DateConversionConfig
Source§impl Default for DateConversionConfig
impl Default for DateConversionConfig
Source§impl PartialEq for DateConversionConfig
impl PartialEq for DateConversionConfig
impl StructuralPartialEq for DateConversionConfig
Auto Trait Implementations§
impl Freeze for DateConversionConfig
impl RefUnwindSafe for DateConversionConfig
impl Send for DateConversionConfig
impl Sync for DateConversionConfig
impl Unpin for DateConversionConfig
impl UnsafeUnpin for DateConversionConfig
impl UnwindSafe for DateConversionConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more