pub struct Template(/* private fields */);Expand description
A rule message with placeholders resolved per match.
Syntax:
{match}— the text the rule matched.{name}— the text of the named capture groupname.{{and}}— literal braces.
Template::parse rejects malformed placeholders, and
Template::validate rejects names that the rule’s regex has no
capture group for — both at config-load time, never mid-lint.
Implementations§
Source§impl Template
impl Template
Sourcepub fn parse(src: &str) -> Result<Self, String>
pub fn parse(src: &str) -> Result<Self, String>
Parses a template, rejecting malformed placeholders.
A { must open a placeholder ({match}, {name}) or escape itself
({{); a lone } is literal text.
Trait Implementations§
impl Eq for Template
impl StructuralPartialEq for Template
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnsafeUnpin for Template
impl UnwindSafe for Template
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.