Enum bbscope::MatchType

source ·
pub enum MatchType {
    Simple(Box<dyn Fn(Captures<'_>) -> String>),
    Open(Arc<ScopeInfo>),
    Close,
}
Expand description

This defines how scopes and whole blocks of text move into the output. Basically: is your matcher using scope or not? If using scope, you need to define an open and close MatchInfo. If not, just use the [Simple] option

Variants§

§

Simple(Box<dyn Fn(Captures<'_>) -> String>)

A match type that requires no scoping rules: just a simple regex replacement (or whatever replacement you want)

§

Open(Arc<ScopeInfo>)

The match should expect an open tag, which increases scope and performs open scope rules

§

Close

The match should expect a closing tag, which decreases scope and performs close scope rules

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.