Module range

Source
Expand description

Handling of date, time, date-time ranges. Needed for range matching. Parsing into ranges happens via partial precision structures (DicomDate, DicomTime, DicomDatime) so ranges can handle null components in date, time, date-time values.

Structs§

DateRange
Represents a date range as two Option<chrono::NaiveDate> values. None means no upper or no lower bound for range is present.
FailOnAmbiguousRange
Fail on an attempt to parse an ambiguous date-time range.
IgnoreTimeZone
Discard known (parsed) time-zone information. Retrieves a DateTimeRange::Naive.
TimeRange
Represents a time range as two Option<chrono::NaiveTime> values. None means no upper or no lower bound for range is present.
ToKnownTimeZone
Use time-zone information from the time-zone aware value. Retrieves a DateTimeRange::TimeZone.
ToLocalTimeZone
For the missing time-zone, use time-zone information of the local system clock. Retrieves a DateTimeRange::TimeZone.

Enums§

DateTimeRange
Represents a date-time range, that can either be time-zone naive or time-zone aware. It is stored as two Option<chrono::DateTime<FixedOffset>> or two Option<chrono::NaiveDateTime> values. None means no upper or no lower bound for range is present.
Error

Traits§

AmbiguousDtRangeParser
The DICOM standard allows for parsing a date-time range in which one DT value provides time-zone information but the other one does not. An example of this is the value 19750101-19800101+0200.
AsRange
The DICOM protocol accepts date (DA) / time (TM) / date-time (DT) values with null components.

Functions§

parse_date_range
Looks for a range separator ‘-’. Returns a DateRange.
parse_datetime_range
Looks for a range separator ‘-’. Returns a DateTimeRange.
parse_datetime_range_custom
Same as parse_datetime_range() but allows for custom handling of ambiguous Date-time ranges. See AmbiguousDtRangeParser.
parse_datetime_range_impl
parse_time_range
Looks for a range separator ‘-’. Returns a TimeRange.