pub(crate) struct ParsedAnnotations<'i> {
input: Bytes<'i>,
time_zone: Option<ParsedTimeZone<'i>>,
}
Expand description
The result of parsing RFC 9557 annotations.
Currently, this only provides access to a parsed time zone annotation, if present. While the parser does validate all other key/value annotations, Jiff doesn’t make use of them and thus does not expose them here. They are only validated at a syntax level.
Fields§
§input: Bytes<'i>
The original input that all of the annotations were parsed from.
N.B. This is currently unused, but potentially useful, so we leave it.
time_zone: Option<ParsedTimeZone<'i>>
An optional time zone annotation that was extracted from the input.
Implementations§
Source§impl<'i> ParsedAnnotations<'i>
impl<'i> ParsedAnnotations<'i>
Sourcepub(crate) fn none() -> ParsedAnnotations<'static>
pub(crate) fn none() -> ParsedAnnotations<'static>
Return an empty parsed annotations.
Sourcepub(crate) fn to_time_zone_annotation(
&self,
) -> Result<Option<TimeZoneAnnotation<'i>>, Error>
pub(crate) fn to_time_zone_annotation( &self, ) -> Result<Option<TimeZoneAnnotation<'i>>, Error>
Turns this parsed time zone into a structured time zone annotation,
if an annotation was found. Otherwise, returns Ok(None)
.
This can return an error if the parsed offset could not be converted
to a crate::tz::Offset
.