pub(super) struct SpanParser {
_priv: (),
}
Expand description
A parser for Temporal spans.
Note that in Temporal, a “span” is called a “duration.”
Fields§
§_priv: ()
There are currently no configuration options for this parser.
Implementations§
Source§impl SpanParser
impl SpanParser
Sourcepub(super) const fn new() -> SpanParser
pub(super) const fn new() -> SpanParser
Create a new Temporal span parser with the default configuration.
pub(super) fn parse_temporal_duration<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, Span>, Error>
pub(super) fn parse_signed_duration<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, SignedDuration>, Error>
fn parse_span<'i>(&self, input: &'i [u8]) -> Result<Parsed<'i, Span>, Error>
fn parse_duration<'i>( &self, input: &'i [u8], ) -> Result<Parsed<'i, SignedDuration>, Error>
Sourcefn parse_date_units<'i>(
&self,
input: &'i [u8],
span: Span,
) -> Result<Parsed<'i, (Span, bool)>, Error>
fn parse_date_units<'i>( &self, input: &'i [u8], span: Span, ) -> Result<Parsed<'i, (Span, bool)>, Error>
Parses consecutive date units from an ISO 8601 duration string into the span given.
If 1 or more units were found, then true
is also returned. Otherwise,
false
indicates that no units were parsed. (Which the caller may want
to treat as an error.)
Sourcefn parse_time_units<'i>(
&self,
input: &'i [u8],
span: Span,
) -> Result<Parsed<'i, (Span, bool)>, Error>
fn parse_time_units<'i>( &self, input: &'i [u8], span: Span, ) -> Result<Parsed<'i, (Span, bool)>, Error>
Parses consecutive time units from an ISO 8601 duration string into the span given.
If 1 or more units were found, then true
is also returned. Otherwise,
false
indicates that no units were parsed. (Which the caller may want
to treat as an error.)
Sourcefn parse_time_units_duration<'i>(
&self,
input: &'i [u8],
negative: bool,
) -> Result<Parsed<'i, SignedDuration>, Error>
fn parse_time_units_duration<'i>( &self, input: &'i [u8], negative: bool, ) -> Result<Parsed<'i, SignedDuration>, Error>
Parses consecutive time units from an ISO 8601 duration string into a Jiff signed duration.
If no time units are found, then this returns an error.