#[non_exhaustive]pub enum TokenKind<'a, CustomTy = ()> {
OpenBBTag(BBTag<'a>),
CloseBBTag(BBTag<'a>, Option<usize>),
StandaloneBBTag(BBTag<'a>),
Text,
Custom(CustomTy),
}Expand description
Represents the type of a token in the parsed data.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
OpenBBTag(BBTag<'a>)
An opening tag in BBCode, ala [tag].
CloseBBTag(BBTag<'a>, Option<usize>)
A closing tag in BBCode, ala [/tag]
StandaloneBBTag(BBTag<'a>)
A standalone (unpaired) tag in BBCode, ala [tag/]
Text
Unformatted text.
Custom(CustomTy)
A custom tag, emitted by a parser rule.
§Remarks
This could be removed entirely when parser rules aren’t present, in the future.
Trait Implementations§
Auto Trait Implementations§
impl<'a, CustomTy> Freeze for TokenKind<'a, CustomTy>where
CustomTy: Freeze,
impl<'a, CustomTy> RefUnwindSafe for TokenKind<'a, CustomTy>where
CustomTy: RefUnwindSafe,
impl<'a, CustomTy> Send for TokenKind<'a, CustomTy>where
CustomTy: Send,
impl<'a, CustomTy> Sync for TokenKind<'a, CustomTy>where
CustomTy: Sync,
impl<'a, CustomTy> Unpin for TokenKind<'a, CustomTy>where
CustomTy: Unpin,
impl<'a, CustomTy> UnwindSafe for TokenKind<'a, CustomTy>where
CustomTy: UnwindSafe,
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