pub struct UnitFunction;Expand description
:unit (functions/number.md, Draft).
Trait Implementations§
Source§impl Clone for UnitFunction
impl Clone for UnitFunction
impl Copy for UnitFunction
Source§impl Debug for UnitFunction
impl Debug for UnitFunction
Source§impl Default for UnitFunction
impl Default for UnitFunction
Source§impl Function for UnitFunction
impl Function for UnitFunction
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 UnitFunction
impl RefUnwindSafe for UnitFunction
impl Send for UnitFunction
impl Sync for UnitFunction
impl Unpin for UnitFunction
impl UnsafeUnpin for UnitFunction
impl UnwindSafe for UnitFunction
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