pub struct NumberFunction { /* private fields */ }Expand description
A numeric handler: :number, :integer or :offset.
Trait Implementations§
Source§impl Clone for NumberFunction
impl Clone for NumberFunction
impl Copy for NumberFunction
Source§impl Debug for NumberFunction
impl Debug for NumberFunction
Source§impl Function for NumberFunction
impl Function for NumberFunction
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
— 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 part_kind(&self) -> &'static str
fn part_kind(&self) -> &'static str
The
type of this handler’s expression parts. A handler whose parts
are "datetime" is a date function (:datetime, :date, :time,
and so may an application’s own): a message that calls one is a
date message, which a Leptos client rewrites after hydration when
the server’s date formatter or zone was not its own (plan/08 §4.3).
Only a date function formats a date: an unannotated date/time is a
Bad Operand. The kind is the mark, so no build pays a method of its
own for it.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 Freeze for NumberFunction
impl RefUnwindSafe for NumberFunction
impl Send for NumberFunction
impl Sync for NumberFunction
impl Unpin for NumberFunction
impl UnsafeUnpin for NumberFunction
impl UnwindSafe for NumberFunction
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