Struct DateTimePrinter

Source
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

Source

pub(super) const fn new() -> DateTimePrinter

Source

pub(super) const fn lowercase(self, yes: bool) -> DateTimePrinter

Source

pub(super) const fn separator(self, ascii_char: u8) -> DateTimePrinter

Source

pub(super) const fn precision(self, precision: Option<u8>) -> DateTimePrinter

Source

pub(super) fn print_zoned<W: Write>( &self, zdt: &Zoned, wtr: W, ) -> Result<(), Error>

Source

pub(super) fn print_timestamp<W: Write>( &self, timestamp: &Timestamp, offset: Option<Offset>, wtr: W, ) -> Result<(), Error>

Source

pub(super) fn print_datetime<W: Write>( &self, dt: &DateTime, wtr: W, ) -> Result<(), Error>

Formats the given datetime into the writer given.

Source

pub(super) fn print_date<W: Write>( &self, date: &Date, wtr: W, ) -> Result<(), Error>

Formats the given date into the writer given.

Source

pub(super) fn print_time<W: Write>( &self, time: &Time, wtr: W, ) -> Result<(), Error>

Formats the given time into the writer given.

Source

pub(super) fn print_time_zone<W: Write>( &self, tz: &TimeZone, wtr: W, ) -> Result<(), Error>

Formats the given time zone into the writer given.

Source

pub(super) fn print_pieces<W: Write>( &self, pieces: &Pieces<'_>, wtr: W, ) -> Result<(), Error>

Source

fn print_pieces_offset<W: Write>( &self, poffset: &PiecesOffset, wtr: W, ) -> Result<(), Error>

Formats the given “pieces” offset into the writer given.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> DateTimePrinter

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DateTimePrinter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DateTimePrinter

Source§

fn default() -> DateTimePrinter

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.