jiff::fmt::rfc9557

Struct Parser

Source
pub(crate) struct Parser {
    _priv: (),
}
Expand description

A parser for RFC 9557 annotations.

Fields§

§_priv: ()

There are currently no configuration options for this parser.

Implementations§

Source§

impl Parser

Source

pub(crate) const fn new() -> Parser

Create a new RFC 9557 annotation parser with the default configuration.

Source

pub(crate) fn parse<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ParsedAnnotations<'i>>, Error>

Parse RFC 9557 annotations from the start of input.

This only parses annotations when input starts with an [.

Note that the result returned only provides access to the time zone annotation (if it was present). All other annotations are parsed and checked for validity, but are not accessible from ParsedAnnotations since Jiff does not make use of them.

Source

fn parse_time_zone_annotation<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, Option<ParsedTimeZone<'i>>>, Error>

Source

fn parse_annotation<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, bool>, Error>

Source

fn parse_tz_annotation_iana_name<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, &'i [u8]>, Error>

Source

fn parse_annotation_key<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, &'i [u8]>, Error>

Source

fn parse_annotation_values<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>

Source

fn parse_annotation_value<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, &'i [u8]>, Error>

Source

fn parse_tz_annotation_leading_char<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>

Source

fn parse_tz_annotation_char<'i>(&self, input: &'i [u8]) -> Parsed<'i, bool>

Source

fn parse_annotation_key_leading_char<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>

Source

fn parse_annotation_key_char<'i>(&self, input: &'i [u8]) -> Parsed<'i, bool>

Source

fn parse_annotation_value_leading_char<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>

Source

fn parse_annotation_value_char<'i>(&self, input: &'i [u8]) -> Parsed<'i, bool>

Source

fn parse_annotation_separator<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>

Source

fn parse_annotation_close<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>

Source

fn parse_tz_annotation_close<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>

Trait Implementations§

Source§

impl Debug for Parser

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Parser

§

impl RefUnwindSafe for Parser

§

impl Send for Parser

§

impl Sync for Parser

§

impl Unpin for Parser

§

impl UnwindSafe for Parser

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.