Skip to content

Commit c16c0e6

Browse files
docs: add docstrings for datetime_range parsing
1 parent f36467b commit c16c0e6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/segment/src/types.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ impl DateTimeWrapper {
8282
}
8383

8484
impl<'de> Deserialize<'de> for DateTimePayloadType {
85+
/// Parses RFC3339 datetime strings used in REST/JSON `datetime_range` filters.
86+
/// Returns a clear user-facing error when the format is invalid.
87+
/// Example accepted value: `2014-01-01T00:00:00Z`.
8588
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
8689
where
8790
D: Deserializer<'de>,
@@ -2629,6 +2632,9 @@ enum RangeInterfaceUntagged {
26292632
}
26302633

26312634
impl<'de> serde::Deserialize<'de> for RangeInterface {
2635+
/// Parses range bounds, treating string bounds as RFC3339 datetimes for REST/JSON `datetime_range` filters.
2636+
/// Preserves clear user-facing errors when datetime formats are invalid.
2637+
/// Example accepted datetime bound: `2014-01-01T00:00:00Z`.
26322638
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
26332639
where
26342640
D: serde::Deserializer<'de>,
@@ -3310,6 +3316,9 @@ impl From<ConditionUntagged> for Condition {
33103316
}
33113317

33123318
impl<'de> serde::Deserialize<'de> for Condition {
3319+
/// Dispatches conditions explicitly so datetime parsing errors from REST/JSON filters stay visible.
3320+
/// Returns readable RFC3339 errors instead of generic untagged enum messages.
3321+
/// Example accepted datetime value: `2014-01-01T00:00:00Z`.
33133322
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
33143323
where
33153324
D: serde::Deserializer<'de>,

0 commit comments

Comments
 (0)