time::parsing::parsable::sealed

Trait Sealed

Source
pub trait Sealed {
    // Required method
    fn parse_into<'a>(
        &self,
        input: &'a [u8],
        parsed: &mut Parsed,
    ) -> Result<&'a [u8], Parse>;

    // Provided methods
    fn parse(&self, input: &[u8]) -> Result<Parsed, Parse> { ... }
    fn parse_date(&self, input: &[u8]) -> Result<Date, Parse> { ... }
    fn parse_time(&self, input: &[u8]) -> Result<Time, Parse> { ... }
    fn parse_offset(&self, input: &[u8]) -> Result<UtcOffset, Parse> { ... }
    fn parse_primitive_date_time(
        &self,
        input: &[u8],
    ) -> Result<PrimitiveDateTime, Parse> { ... }
    fn parse_utc_date_time(&self, input: &[u8]) -> Result<UtcDateTime, Parse> { ... }
    fn parse_offset_date_time(
        &self,
        input: &[u8],
    ) -> Result<OffsetDateTime, Parse> { ... }
}
Available on crate feature parsing only.
Expand description

Parse the item using a format description and an input.

Required Methods§

Source

fn parse_into<'a>( &self, input: &'a [u8], parsed: &mut Parsed, ) -> Result<&'a [u8], Parse>

Parse the item into the provided Parsed struct.

This method can be used to parse a single component without parsing the full value.

Provided Methods§

Source

fn parse(&self, input: &[u8]) -> Result<Parsed, Parse>

Parse the item into a new Parsed struct.

This method can only be used to parse a complete value of a type. If any characters remain after parsing, an error will be returned.

Source

fn parse_date(&self, input: &[u8]) -> Result<Date, Parse>

Parse a Date from the format description.

Source

fn parse_time(&self, input: &[u8]) -> Result<Time, Parse>

Parse a Time from the format description.

Source

fn parse_offset(&self, input: &[u8]) -> Result<UtcOffset, Parse>

Parse a UtcOffset from the format description.

Source

fn parse_primitive_date_time( &self, input: &[u8], ) -> Result<PrimitiveDateTime, Parse>

Parse a PrimitiveDateTime from the format description.

Source

fn parse_utc_date_time(&self, input: &[u8]) -> Result<UtcDateTime, Parse>

Parse a UtcDateTime from the format description.

Source

fn parse_offset_date_time(&self, input: &[u8]) -> Result<OffsetDateTime, Parse>

Parse a OffsetDateTime from the format description.

Implementations on Foreign Types§

Source§

impl Sealed for [BorrowedFormatItem<'_>]

Source§

fn parse_into<'a>( &self, input: &'a [u8], parsed: &mut Parsed, ) -> Result<&'a [u8], Parse>

Source§

impl Sealed for [OwnedFormatItem]

Available on crate feature alloc only.
Source§

fn parse_into<'a>( &self, input: &'a [u8], parsed: &mut Parsed, ) -> Result<&'a [u8], Parse>

Implementors§

Source§

impl Sealed for BorrowedFormatItem<'_>

Source§

impl Sealed for OwnedFormatItem

Available on crate feature alloc only.
Source§

impl Sealed for Rfc2822

Source§

impl Sealed for Rfc3339

Source§

impl<T: Deref> Sealed for T
where T::Target: Sealed,

Source§

impl<const CONFIG: EncodedConfig> Sealed for Iso8601<CONFIG>