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
impl Parser
Sourcepub(crate) const fn new() -> Parser
pub(crate) const fn new() -> Parser
Create a new RFC 9557 annotation parser with the default configuration.
Sourcepub(crate) fn parse<'i>(
&self,
input: &'i [u8],
) -> Result<Parsed<'i, ParsedAnnotations<'i>>, Error>
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.
fn parse_time_zone_annotation<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, Option<ParsedTimeZone<'i>>>, Error>
fn parse_annotation<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, bool>, Error>
fn parse_tz_annotation_iana_name<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, &'i [u8]>, Error>
fn parse_annotation_key<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, &'i [u8]>, Error>
fn parse_annotation_values<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>
fn parse_annotation_value<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, &'i [u8]>, Error>
fn parse_tz_annotation_leading_char<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>
fn parse_tz_annotation_char<'i>(&self, input: &'i [u8]) -> Parsed<'i, bool>
fn parse_annotation_key_leading_char<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>
fn parse_annotation_key_char<'i>(&self, input: &'i [u8]) -> Parsed<'i, bool>
fn parse_annotation_value_leading_char<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>
fn parse_annotation_value_char<'i>(&self, input: &'i [u8]) -> Parsed<'i, bool>
fn parse_annotation_separator<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>
fn parse_annotation_close<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>
fn parse_tz_annotation_close<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, ()>, Error>
Trait Implementations§
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> 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
Mutably borrows from an owned value. Read more