Skip to main content

Module templater

Module templater 

Source
Expand description

Tools for lazily evaluating templates that produce text in a fallible manner.

Structs§

CoalesceTemplate
Renders contents in order, and returns the first non-empty output.
ConcatTemplate
ConditionalProperty
AnyTemplateProperty which selects an output based on a boolean condition.
ConditionalTemplate
Template which selects an output based on a boolean condition.
Email
FormattablePropertyTemplate
Adapter to extract template value from property for displaying.
HyperlinkTemplate
Renders a hyperlink using OSC 8 escape sequences when supported, or a fallback otherwise.
JoinTemplate
Like ConcatTemplate, but inserts a separator between contents.
LabelTemplate
ListMapProperty
Result of a map() operation.
ListPropertyTemplate
Renders template property of list type with the given separator.
Literal
Adapter that wraps literal value in TemplateProperty.
PlainTextFormattedProperty
Adapter to turn template back to byte string property.
PropertyPlaceholder
Property which will be compiled into template once, and substituted later.
RawEscapeSequenceTemplate
ReformatTemplate
Renders the content to buffer, and transforms it without losing labels.
RegexCaptures
Captures from a regex match, accessible by index or name.
SeparateTemplate
Like JoinTemplate, but ignores empty contents.
TemplateFormatter
Wrapper to pass around Formatter and error handler.
TemplateFunction
Adapter to apply fallible function to the property.
TemplatePropertyError
Wrapper around an error occurred during template evaluation.
TemplateRenderer
Adapter that renders compiled template with the placeholder value set.

Traits§

AnyTemplateProperty
Abstraction trait for a type-erased TemplateProperty
Template
Represents a printable type or a compiled template containing a placeholder value.
TemplateProperty
Lazily evaluated value which can fail to evaluate.
TemplatePropertyExt
TemplateProperty adapters that are useful when implementing methods.
WrapTemplateProperty
Wraps template property of type O in tagged type.

Functions§

format_joined

Type Aliases§

BoxedAnyProperty
BoxedSerializeProperty
BoxedTemplateProperty
Type-erased TemplateProperty.
SizeHint