CowStr

Trait CowStr 

Source
pub trait CowStr<'a> {
    // Required method
    fn cow_str(self) -> Cow<'a, str>;
}
Expand description

A trait intended to be used by filters for any string-like arguments to deal with them more efficiently than str or impl Display. Any expression or filter prefixed by > in a template will convert the value to CowStrWrapper which implements this trait.

§Example template

{{ >message | append(>"!") }}

Required Methods§

Source

fn cow_str(self) -> Cow<'a, str>

Extract the contained Cow<str>. Intended to be called from filters to deal with strings more efficiently.

Implementors§

Source§

impl<'a> CowStr<'a> for CowStrWrapper<'a>