pub struct Neutral;Expand description
The neutral backend. Its text is the same in every locale: the pieces the options ask for, in the order date, weekday, time, zone, separated by one space —
| Option | Piece |
|---|---|
year-month-day | 2006-01-02 (a year outside 0–9999: +010000, -000044) |
month-day | --01-02 |
day-weekday | ---02 |
weekday, …-weekday | Mon … Sun |
hour / minute / second | 15 / 15:04 / 15:04:06 |
hour12=true | 03 PM / 03:04 PM / 03:04:06 PM (12 AM at midnight) |
timeZoneStyle=short | Z or +05:30 (+hh:mm:ss if it has seconds); the zone’s name if its offset is not known |
timeZoneStyle=long | UTC, +05:30, or the zone’s name (Europe/Paris) |
So {|2006-01-02T15:04:06| :datetime} is 2006-01-02 15:04. The
length (dateLength, length) and calendar do not change it: it is
always the ISO (proleptic Gregorian) calendar.
Trait Implementations§
Source§impl Backend for Neutral
impl Backend for Neutral
Source§fn format(&self, _cx: &FnContext<'_>, plan: &Plan<'_>, out: &mut dyn Sink)
fn format(&self, _cx: &FnContext<'_>, plan: &Plan<'_>, out: &mut dyn Sink)
Writes
plan for cx.locale().Source§fn supports(
&self,
cx: &FnContext<'_>,
plan: &Plan<'_>,
) -> Result<(), FormatError>
fn supports( &self, cx: &FnContext<'_>, plan: &Plan<'_>, ) -> Result<(), FormatError>
Whether
plan can be formatted. Err(e): the placeholder becomes
a fallback value and e is reported (e.g. Unsupported
Operation for a calendar the backend’s data lacks). Called before
dir and format.Source§fn format_parts(
&self,
cx: &FnContext<'_>,
plan: &Plan<'_>,
out: &mut dyn SubPartSink,
)
fn format_parts( &self, cx: &FnContext<'_>, plan: &Plan<'_>, out: &mut dyn SubPartSink, )
Writes
plan’s sub-parts (none by default).impl Copy for Neutral
Auto Trait Implementations§
impl Freeze for Neutral
impl RefUnwindSafe for Neutral
impl Send for Neutral
impl Sync for Neutral
impl Unpin for Neutral
impl UnsafeUnpin for Neutral
impl UnwindSafe for Neutral
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more