Enum chrono::format::Fixed

source ·
#[non_exhaustive]
pub enum Fixed {
Show 20 variants ShortMonthName, LongMonthName, ShortWeekdayName, LongWeekdayName, LowerAmPm, UpperAmPm, Nanosecond, Nanosecond3, Nanosecond6, Nanosecond9, TimezoneName, TimezoneOffsetColon, TimezoneOffsetDoubleColon, TimezoneOffsetTripleColon, TimezoneOffsetColonZ, TimezoneOffset, TimezoneOffsetZ, RFC2822, RFC3339, Internal(InternalFixed),
}
Expand description

Fixed-format item types.

They have their own rules of formatting and parsing. Otherwise noted, they print in the specified cases but parse case-insensitively.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ShortMonthName

Abbreviated month names.

Prints a three-letter-long name in the title case, reads the same name in any case.

§

LongMonthName

Full month names.

Prints a full name in the title case, reads either a short or full name in any case.

§

ShortWeekdayName

Abbreviated day of the week names.

Prints a three-letter-long name in the title case, reads the same name in any case.

§

LongWeekdayName

Full day of the week names.

Prints a full name in the title case, reads either a short or full name in any case.

§

LowerAmPm

AM/PM.

Prints in lower case, reads in any case.

§

UpperAmPm

AM/PM.

Prints in upper case, reads in any case.

§

Nanosecond

An optional dot plus one or more digits for left-aligned nanoseconds. May print nothing, 3, 6 or 9 digits according to the available accuracy. See also Numeric::Nanosecond.

§

Nanosecond3

Same as Nanosecond but the accuracy is fixed to 3.

§

Nanosecond6

Same as Nanosecond but the accuracy is fixed to 6.

§

Nanosecond9

Same as Nanosecond but the accuracy is fixed to 9.

§

TimezoneName

Timezone name.

It does not support parsing, its use in the parser is an immediate failure.

§

TimezoneOffsetColon

Offset from the local time to UTC (+09:00 or -04:00 or +00:00).

In the parser, the colon can be omitted and/or surrounded with any amount of whitespace. The offset is limited from -24:00 to +24:00, which is the same as FixedOffset’s range.

§

TimezoneOffsetDoubleColon

Offset from the local time to UTC with seconds (+09:00:00 or -04:00:00 or +00:00:00).

In the parser, the colon can be omitted and/or surrounded with any amount of whitespace. The offset is limited from -24:00:00 to +24:00:00, which is the same as FixedOffset’s range.

§

TimezoneOffsetTripleColon

Offset from the local time to UTC without minutes (+09 or -04 or +00).

In the parser, the colon can be omitted and/or surrounded with any amount of whitespace. The offset is limited from -24 to +24, which is the same as FixedOffset’s range.

§

TimezoneOffsetColonZ

Offset from the local time to UTC (+09:00 or -04:00 or Z).

In the parser, the colon can be omitted and/or surrounded with any amount of whitespace, and Z can be either in upper case or in lower case. The offset is limited from -24:00 to +24:00, which is the same as FixedOffset’s range.

§

TimezoneOffset

Same as TimezoneOffsetColon but prints no colon. Parsing allows an optional colon.

§

TimezoneOffsetZ

Same as TimezoneOffsetColonZ but prints no colon. Parsing allows an optional colon.

§

RFC2822

RFC 2822 date and time syntax. Commonly used for email and MIME date and time.

§

RFC3339

RFC 3339 & ISO 8601 date and time syntax.

§

Internal(InternalFixed)

Internal uses only.

This item exists so that one can add additional internal-only formatting without breaking major compatibility (as enum variants cannot be selectively private).

Trait Implementations§

source§

impl Clone for Fixed

source§

fn clone(&self) -> Fixed

Returns a copy 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 Fixed

source§

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

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

impl Hash for Fixed

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Fixed

source§

fn eq(&self, other: &Fixed) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Fixed

source§

impl StructuralPartialEq for Fixed

Auto Trait Implementations§

§

impl Freeze for Fixed

§

impl RefUnwindSafe for Fixed

§

impl Send for Fixed

§

impl Sync for Fixed

§

impl Unpin for Fixed

§

impl UnwindSafe for Fixed

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> 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,

§

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>,

§

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>,

§

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.