pub(super) struct DateTimePrinter {
lowercase: bool,
separator: u8,
rfc9557: bool,
precision: Option<u8>,
}
Fields§
§lowercase: bool
§separator: u8
§rfc9557: bool
§precision: Option<u8>
Implementations§
Source§impl DateTimePrinter
impl DateTimePrinter
pub(super) const fn new() -> DateTimePrinter
pub(super) const fn lowercase(self, yes: bool) -> DateTimePrinter
pub(super) const fn separator(self, ascii_char: u8) -> DateTimePrinter
pub(super) const fn precision(self, precision: Option<u8>) -> DateTimePrinter
pub(super) fn print_zoned<W: Write>( &self, zdt: &Zoned, wtr: W, ) -> Result<(), Error>
pub(super) fn print_timestamp<W: Write>( &self, timestamp: &Timestamp, offset: Option<Offset>, wtr: W, ) -> Result<(), Error>
Sourcepub(super) fn print_datetime<W: Write>(
&self,
dt: &DateTime,
wtr: W,
) -> Result<(), Error>
pub(super) fn print_datetime<W: Write>( &self, dt: &DateTime, wtr: W, ) -> Result<(), Error>
Formats the given datetime into the writer given.
Sourcepub(super) fn print_date<W: Write>(
&self,
date: &Date,
wtr: W,
) -> Result<(), Error>
pub(super) fn print_date<W: Write>( &self, date: &Date, wtr: W, ) -> Result<(), Error>
Formats the given date into the writer given.
Sourcepub(super) fn print_time<W: Write>(
&self,
time: &Time,
wtr: W,
) -> Result<(), Error>
pub(super) fn print_time<W: Write>( &self, time: &Time, wtr: W, ) -> Result<(), Error>
Formats the given time into the writer given.
Sourcepub(super) fn print_time_zone<W: Write>(
&self,
tz: &TimeZone,
wtr: W,
) -> Result<(), Error>
pub(super) fn print_time_zone<W: Write>( &self, tz: &TimeZone, wtr: W, ) -> Result<(), Error>
Formats the given time zone into the writer given.
pub(super) fn print_pieces<W: Write>( &self, pieces: &Pieces<'_>, wtr: W, ) -> Result<(), Error>
Sourcefn print_pieces_offset<W: Write>(
&self,
poffset: &PiecesOffset,
wtr: W,
) -> Result<(), Error>
fn print_pieces_offset<W: Write>( &self, poffset: &PiecesOffset, wtr: W, ) -> Result<(), Error>
Formats the given “pieces” offset into the writer given.
Sourcefn print_offset_rounded<W: Write>(
&self,
offset: &Offset,
wtr: W,
) -> Result<(), Error>
fn print_offset_rounded<W: Write>( &self, offset: &Offset, wtr: W, ) -> Result<(), Error>
Formats the given offset into the writer given.
If the given offset has non-zero seconds, then they are rounded to the nearest minute.
Sourcefn print_offset_full_precision<W: Write>(
&self,
offset: &Offset,
wtr: W,
) -> Result<(), Error>
fn print_offset_full_precision<W: Write>( &self, offset: &Offset, wtr: W, ) -> Result<(), Error>
Formats the given offset into the writer given.
If the given offset has non-zero seconds, then they are emitted as a
third :
-delimited component of the offset. If seconds are zero, then
only the hours and minute components are emitted.
Sourcefn print_zulu<W: Write>(&self, wtr: W) -> Result<(), Error>
fn print_zulu<W: Write>(&self, wtr: W) -> Result<(), Error>
Prints the “zulu” indicator.
This should only be used when the offset is not known. For example,
when printing a Timestamp
.
Sourcefn print_time_zone_annotation<W: Write>(
&self,
time_zone: &TimeZone,
offset: &Offset,
wtr: W,
) -> Result<(), Error>
fn print_time_zone_annotation<W: Write>( &self, time_zone: &TimeZone, offset: &Offset, wtr: W, ) -> Result<(), Error>
Formats the given time zone name into the writer given as an RFC 9557 time zone annotation.
This is a no-op when RFC 9557 support isn’t enabled. And when the given time zone is not an IANA time zone name, then the offset is printed instead. (This means the offset will be printed twice, which is indeed an intended behavior of RFC 9557 for cases where a time zone name is not used or unavailable.)
Trait Implementations§
Source§impl Clone for DateTimePrinter
impl Clone for DateTimePrinter
Source§fn clone(&self) -> DateTimePrinter
fn clone(&self) -> DateTimePrinter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more