DateTimePrinter

Struct DateTimePrinter 

Source
pub(super) struct DateTimePrinter {
    lowercase: bool,
    separator: u8,
    precision: Option<u8>,
}

Fields§

§lowercase: bool§separator: u8§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( &self, zdt: &Zoned, wtr: &mut dyn Write, ) -> Result<(), Error>

Source

fn print_zoned_buf(&self, zdt: &Zoned, bbuf: &mut BorrowedBuffer<'_>)

Source

fn print_zoned_wtr( &self, zdt: &Zoned, wtr: &mut BorrowedWriter<'_, '_, '_>, ) -> Result<(), Error>

Source

pub(super) fn print_timestamp( &self, timestamp: &Timestamp, wtr: &mut dyn Write, ) -> Result<(), Error>

Source

fn print_timestamp_buf( &self, timestamp: &Timestamp, bbuf: &mut BorrowedBuffer<'_>, )

Source

pub(super) fn print_timestamp_with_offset( &self, timestamp: &Timestamp, offset: Offset, wtr: &mut dyn Write, ) -> Result<(), Error>

Source

fn print_timestamp_with_offset_buf( &self, timestamp: &Timestamp, offset: Offset, bbuf: &mut BorrowedBuffer<'_>, )

Source

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

Source

fn print_datetime_buf(&self, dt: &DateTime, bbuf: &mut BorrowedBuffer<'_>)

Source

fn print_datetime_wtr( &self, dt: &DateTime, wtr: &mut BorrowedWriter<'_, '_, '_>, ) -> Result<(), Error>

Source

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

Source

fn print_date_buf(&self, date: &Date, bbuf: &mut BorrowedBuffer<'_>)

Source

fn print_date_wtr( &self, date: &Date, wtr: &mut BorrowedWriter<'_, '_, '_>, ) -> Result<(), Error>

Source

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

Source

fn print_time_buf(&self, time: &Time, bbuf: &mut BorrowedBuffer<'_>)

Source

fn print_time_wtr( &self, time: &Time, wtr: &mut BorrowedWriter<'_, '_, '_>, ) -> Result<(), Error>

Source

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

Source

fn print_time_zone_wtr( &self, tz: &TimeZone, wtr: &mut dyn Write, ) -> Result<(), Error>

Source

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

Source

fn print_pieces_wtr( &self, pieces: &Pieces<'_>, wtr: &mut BorrowedWriter<'_, '_, '_>, ) -> Result<(), Error>

Source

pub(super) fn print_iso_week_date( &self, iso_week_date: &ISOWeekDate, wtr: &mut dyn Write, ) -> Result<(), Error>

Source

fn print_iso_week_date_buf( &self, iso_week_date: &ISOWeekDate, bbuf: &mut BorrowedBuffer<'_>, )

Source

fn print_pieces_offset( &self, poffset: &PiecesOffset, wtr: &mut BorrowedWriter<'_, '_, '_>, ) -> Result<(), Error>

Source

fn print_offset_rounded_buf( &self, offset: &Offset, bbuf: &mut BorrowedBuffer<'_>, )

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_rounded_wtr( &self, offset: &Offset, wtr: &mut BorrowedWriter<'_, '_, '_>, ) -> 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( &self, offset: &Offset, bbuf: &mut BorrowedBuffer<'_>, )

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_buf(&self, bbuf: &mut BorrowedBuffer<'_>)

Prints the “zulu” indicator.

This should only be used when the offset is not known. For example, when printing a Timestamp.

Source

fn print_zulu_wtr( &self, wtr: &mut BorrowedWriter<'_, '_, '_>, ) -> 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_buf( &self, time_zone: &TimeZone, offset: &Offset, bbuf: &mut BorrowedBuffer<'_>, )

Formats the given time zone name into the writer given as an RFC 9557 time zone annotation.

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.)

Source

fn print_time_zone_annotation_wtr( &self, time_zone: &TimeZone, offset: &Offset, wtr: &mut BorrowedWriter<'_, '_, '_>, ) -> Result<(), Error>

Formats the given time zone name into the writer given as an RFC 9557 time zone annotation.

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.