pub struct NumberFunction { /* private fields */ }Expand description
A localized numeric handler: :number, :integer, :offset or
:percent.
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
(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 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