pub struct FormatDescriptionV3<'a> {
pub(crate) inner: FormatDescriptionV3Inner<'a>,
pub(crate) max_bytes_needed: usize,
}Expand description
A complete description of how to format and parse a type.
Both for forwards compatibility and to enable optimizations, this type is deliberately opaque
and cannot be constructed by users of the crate. Instead, it is returned by the
format_description! macro (when version=3 is used) as well as the parse_borrowed and
parse_owned methods.
Fields§
§inner: FormatDescriptionV3Inner<'a>The inner enum that controls all business logic.
max_bytes_needed: usizeThe maximum number of bytes that are needed to format any value using this format description.
Implementations§
Source§impl FormatDescriptionV3<'_>
impl FormatDescriptionV3<'_>
Sourcepub fn to_owned(self) -> FormatDescriptionV3<'static>
pub fn to_owned(self) -> FormatDescriptionV3<'static>
Convert the format description to an owned version, enabling it to be stored without regard for lifetime.
Trait Implementations§
Source§impl<'a> Clone for FormatDescriptionV3<'a>
impl<'a> Clone for FormatDescriptionV3<'a>
Source§fn clone(&self) -> FormatDescriptionV3<'a>
fn clone(&self) -> FormatDescriptionV3<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComputeMetadata for FormatDescriptionV3<'_>
impl ComputeMetadata for FormatDescriptionV3<'_>
Source§fn compute_metadata(&self, _: PrivateMethod) -> Metadata
fn compute_metadata(&self, _: PrivateMethod) -> Metadata
Compute the metadata for a format description.
Source§impl Debug for FormatDescriptionV3<'_>
impl Debug for FormatDescriptionV3<'_>
Source§impl Sealed for FormatDescriptionV3<'_>
impl Sealed for FormatDescriptionV3<'_>
Source§fn format_into<V>(
&self,
output: &mut (impl Write + ?Sized),
value: &V,
state: &mut V::State,
_: PrivateMethod,
) -> Result<usize, Format>where
V: ComponentProvider,
fn format_into<V>(
&self,
output: &mut (impl Write + ?Sized),
value: &V,
state: &mut V::State,
_: PrivateMethod,
) -> Result<usize, Format>where
V: ComponentProvider,
Format the item into the provided output, returning the number of bytes written.
Source§fn format<V>(
&self,
value: &V,
state: &mut V::State,
_: PrivateMethod,
) -> Result<String, Format>where
V: ComponentProvider,
fn format<V>(
&self,
value: &V,
state: &mut V::State,
_: PrivateMethod,
) -> Result<String, Format>where
V: ComponentProvider,
Format the item directly to a
String.Source§impl Sealed for FormatDescriptionV3<'_>
impl Sealed for FormatDescriptionV3<'_>
Source§fn 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>
Source§fn 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>
Source§fn 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.Source§fn 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.Source§fn 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.Source§fn parse_primitive_date_time(
&self,
input: &[u8],
defaults: Option<Parsed>,
_: PrivateMethod,
) -> Result<PrimitiveDateTime, Parse>
fn parse_primitive_date_time( &self, input: &[u8], defaults: Option<Parsed>, _: PrivateMethod, ) -> Result<PrimitiveDateTime, Parse>
Parse a
PrimitiveDateTime from the format description.Source§fn 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.Source§fn 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.impl Formattable for FormatDescriptionV3<'_>
impl Parsable for FormatDescriptionV3<'_>
Auto Trait Implementations§
impl<'a> Freeze for FormatDescriptionV3<'a>
impl<'a> RefUnwindSafe for FormatDescriptionV3<'a>
impl<'a> Send for FormatDescriptionV3<'a>
impl<'a> Sync for FormatDescriptionV3<'a>
impl<'a> Unpin for FormatDescriptionV3<'a>
impl<'a> UnsafeUnpin for FormatDescriptionV3<'a>
impl<'a> UnwindSafe for FormatDescriptionV3<'a>
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