pub trait Sealed {
// Required method
fn parse_into<'a>(
&self,
input: &'a [u8],
parsed: &mut Parsed,
_: PrivateMethod,
) -> Result<&'a [u8], Parse>;
// Provided methods
#[doc(hidden)] fn parse(&self, input: &[u8]) -> Result<Parsed, Parse> { ... }
fn parse_internal(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<Parsed, Parse> { ... }
fn parse_date(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<Date, Parse> { ... }
fn parse_time(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<Time, Parse> { ... }
fn parse_offset(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<UtcOffset, Parse> { ... }
fn parse_plain_date_time(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<PlainDateTime, Parse> { ... }
fn parse_utc_date_time(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<UtcDateTime, Parse> { ... }
fn parse_offset_date_time(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<OffsetDateTime, Parse> { ... }
fn parse_timestamp(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<Timestamp, Parse> { ... }
}parsing only.Expand description
Parse the item using a format description and an input.
Required Methods§
Sourcefn parse_into<'a>(
&self,
input: &'a [u8],
parsed: &mut Parsed,
_: PrivateMethod,
) -> Result<&'a [u8], Parse>
fn parse_into<'a>( &self, input: &'a [u8], parsed: &mut Parsed, _: PrivateMethod, ) -> 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#[doc(hidden)]fn parse(&self, input: &[u8]) -> Result<Parsed, Parse>
👎Deprecated since 0.3.53: use the parse method on the target type; this method has never been part of the public API and will be removed in a future release
#[doc(hidden)]fn parse(&self, input: &[u8]) -> Result<Parsed, Parse>
use the parse method on the target type; this method has never been part of the public API and will be removed in a future release
§DO NOT USE THIS METHOD
This method is for internal use only, has never been part of the public API, and will be removed in a future release. If you are relying on the existence of this method, your code will be broken in the future. The removal of this method will not be considered a breaking change due to the internal nature and the fact that it was never documented as part of the public API.
You should use the parse method on the target type instead. For example, to parse a
Date, use Date::parse.
Sourcefn parse_internal(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<Parsed, Parse>
fn parse_internal( &self, input: &[u8], defaults: Option<Parsed>, _: PrivateMethod, ) -> Result<Parsed, Parse>
Parse the items into a Parsed struct, using the provided defaults for any components
that are not present in the input.
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.
Sourcefn parse_date(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<Date, Parse>
fn parse_date( &self, input: &[u8], defaults: Option<Parsed>, _: PrivateMethod, ) -> Result<Date, Parse>
Parse a Date from the format description.
Sourcefn parse_time(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<Time, Parse>
fn parse_time( &self, input: &[u8], defaults: Option<Parsed>, _: PrivateMethod, ) -> Result<Time, Parse>
Parse a Time from the format description.
Sourcefn parse_offset(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<UtcOffset, Parse>
fn parse_offset( &self, input: &[u8], defaults: Option<Parsed>, _: PrivateMethod, ) -> Result<UtcOffset, Parse>
Parse a UtcOffset from the format description.
Sourcefn parse_plain_date_time(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<PlainDateTime, Parse>
fn parse_plain_date_time( &self, input: &[u8], defaults: Option<Parsed>, _: PrivateMethod, ) -> Result<PlainDateTime, Parse>
Parse a PlainDateTime from the format description.
Sourcefn parse_utc_date_time(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<UtcDateTime, Parse>
fn parse_utc_date_time( &self, input: &[u8], defaults: Option<Parsed>, _: PrivateMethod, ) -> Result<UtcDateTime, Parse>
Parse a UtcDateTime from the format description.
Sourcefn parse_offset_date_time(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<OffsetDateTime, Parse>
fn parse_offset_date_time( &self, input: &[u8], defaults: Option<Parsed>, _: PrivateMethod, ) -> Result<OffsetDateTime, Parse>
Parse a OffsetDateTime from the format description.
Sourcefn parse_timestamp(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<Timestamp, Parse>
fn parse_timestamp( &self, input: &[u8], defaults: Option<Parsed>, _: PrivateMethod, ) -> Result<Timestamp, Parse>
Parse a Timestamp from the format description.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Sealed for [BorrowedFormatItem<'_>]
impl Sealed for [BorrowedFormatItem<'_>]
fn parse_into<'a>( &self, input: &'a [u8], parsed: &mut Parsed, _: PrivateMethod, ) -> Result<&'a [u8], Parse>
Source§impl Sealed for [OwnedFormatItem]
Available on crate feature alloc only.
impl Sealed for [OwnedFormatItem]
alloc only.fn parse_into<'a>( &self, input: &'a [u8], parsed: &mut Parsed, _: PrivateMethod, ) -> Result<&'a [u8], Parse>
Implementors§
impl Sealed for BorrowedFormatItem<'_>
impl Sealed for FormatDescriptionV3<'_>
impl Sealed for OwnedFormatItem
alloc only.