pub struct StringFunction;Expand description
The :string handler.
Trait Implementations§
Source§impl Clone for StringFunction
impl Clone for StringFunction
impl Copy for StringFunction
Source§impl Debug for StringFunction
impl Debug for StringFunction
Source§impl Default for StringFunction
impl Default for StringFunction
Source§impl Function for StringFunction
impl Function for StringFunction
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 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 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.Source§fn matches(
&self,
cx: &FnContext<'_>,
value: &Value<'_>,
key: &str,
_errs: &mut dyn ErrorSink,
) -> bool
fn matches( &self, cx: &FnContext<'_>, value: &Value<'_>, key: &str, _errs: &mut dyn ErrorSink, ) -> bool
Match(
value, key); key is NFC. Report e.g. Bad Variant Key
through errs.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_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).Auto Trait Implementations§
impl Freeze for StringFunction
impl RefUnwindSafe for StringFunction
impl Send for StringFunction
impl Sync for StringFunction
impl Unpin for StringFunction
impl UnsafeUnpin for StringFunction
impl UnwindSafe for StringFunction
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