pub struct DateTimeFunction<B = DefaultBackend> { /* private fields */ }Expand description
A date/time handler over the backend B: :datetime, :date,
:time, or the unannotated one — the statics crate::DATETIME,
crate::DATE, crate::TIME, crate::DATES over the default
backend, or one built with the constructors over another.
Implementations§
Source§impl<B> DateTimeFunction<B>
impl<B> DateTimeFunction<B>
Sourcepub const fn unannotated(backend: B) -> Self
pub const fn unannotated(backend: B) -> Self
The handler of unannotated date/time values, for
Registry::with_dates: a value is formatted as :datetime with no
options would format it — its own override options apply — and if
that resolution reports an error, it is a fallback value with that
error. Named in a registry, it is :datetime.
Trait Implementations§
Source§impl<B: Clone> Clone for DateTimeFunction<B>
impl<B: Clone> Clone for DateTimeFunction<B>
impl<B: Copy> Copy for DateTimeFunction<B>
Source§impl<B: Debug> Debug for DateTimeFunction<B>
impl<B: Debug> Debug for DateTimeFunction<B>
Source§impl<B: Backend> Function for DateTimeFunction<B>
impl<B: Backend> Function for DateTimeFunction<B>
Source§fn resolve<'a>(
&self,
cx: &FnContext<'_>,
operand: Option<&Value<'a>>,
options: &Options<'_, 'a>,
errs: &mut dyn ErrorSink,
) -> Option<Value<'a>>
fn resolve<'a>( &self, cx: &FnContext<'_>, operand: Option<&Value<'a>>, options: &Options<'_, 'a>, errs: &mut dyn ErrorSink, ) -> Option<Value<'a>>
Function resolution (formatting.md):
operand resolved — a
Value::Fallback when it failed to resolve, so the handler decides
(plans/03-runtime.md §2.6) — and options resolved with
u:id/u:dir removed. None makes the expression a fallback value;
the handler has reported why.Source§fn formattable(
&self,
cx: &FnContext<'_>,
value: &Value<'_>,
) -> Result<(), FormatError>
fn formattable( &self, cx: &FnContext<'_>, value: &Value<'_>, ) -> Result<(), FormatError>
Whether
value can be formatted. Err(e): the placeholder is a
fallback value and e is reported.Source§fn format(&self, cx: &FnContext<'_>, value: &Value<'_>, out: &mut dyn Sink)
fn format(&self, cx: &FnContext<'_>, value: &Value<'_>, out: &mut dyn Sink)
Writes
value’s formatted text.Source§fn format_parts(
&self,
cx: &FnContext<'_>,
value: &Value<'_>,
out: &mut dyn SubPartSink,
)
fn format_parts( &self, cx: &FnContext<'_>, value: &Value<'_>, out: &mut dyn SubPartSink, )
Writes
value’s formatted sub-parts (none by default).Source§fn dir(&self, cx: &FnContext<'_>, value: &Value<'_>) -> Dir
fn dir(&self, cx: &FnContext<'_>, value: &Value<'_>) -> Dir
The direction of
value’s formatted text (Default Bidi Strategy);
Auto = unknown.Source§fn selectable(&self, value: &Value<'_>) -> bool
fn selectable(&self, value: &Value<'_>) -> bool
Whether
value supports selection (formatting.md, “Resolve
Selectors”). A value that does not matches only *, with Bad
Selector.Auto Trait Implementations§
impl<B> Freeze for DateTimeFunction<B>where
B: Freeze,
impl<B> RefUnwindSafe for DateTimeFunction<B>where
B: RefUnwindSafe,
impl<B> Send for DateTimeFunction<B>where
B: Send,
impl<B> Sync for DateTimeFunction<B>where
B: Sync,
impl<B> Unpin for DateTimeFunction<B>where
B: Unpin,
impl<B> UnsafeUnpin for DateTimeFunction<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for DateTimeFunction<B>where
B: UnwindSafe,
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