pub struct ScopeInfo {
pub only: Option<Vec<&'static str>>,
pub double_closes: bool,
pub emit: EmitScope,
}Expand description
Information about a scoped tag with open and close elements. This gives you the power to craft many kinds of markup, not just bbcode, and have it understand scope
Fields§
§only: Option<Vec<&'static str>>A list of MatchInfo ids for tags which are allowed to be parsed within the body of
this scope. If None, any tag is allowed (default)
double_closes: boolWhether or not this scope automatically closes previous scopes of the same type. Generally this isn’t how tags work: doing [b][b][b]EXTRA BOLD[/b][/b][/b] produces triple bold text. However, elements like [*] (list item) benefit from closing the previous scope if it’s the same type
emit: EmitScopeThe core of the parsing system: your provided closure which transforms the pre-parsed data given into HTML (or whatever)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScopeInfo
impl !RefUnwindSafe for ScopeInfo
impl Send for ScopeInfo
impl Sync for ScopeInfo
impl Unpin for ScopeInfo
impl !UnwindSafe for ScopeInfo
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