pub enum Item<'a, Tag = LSpan<'a>> {
PlainText(LSpan<'a>),
Element(Vec<Tag>, Vec<Item<'a, Tag>>),
}Expand description
AST item.
In parsing stage, each line of source code will be parsed as a Vec<Item>, so the final result is Vec<Vec<Item>>.
Tag conversion stage, Each tag will be converted from LSpan into Tag type the generator needed,
by using TagConvertor of the generator.
In generating stage, generator will convert Vec<Vec<Item<'_, Tag>>>> to final output.
Variants§
PlainText(LSpan<'a>)
Plain text(escaped) without any style.
Element(Vec<Tag>, Vec<Item<'a, Tag>>)
A styled element, contains a series tag name and subitems.
Trait Implementations§
impl<'a, Tag> StructuralPartialEq for Item<'a, Tag>
Auto Trait Implementations§
impl<'a, Tag> Freeze for Item<'a, Tag>
impl<'a, Tag> RefUnwindSafe for Item<'a, Tag>where
Tag: RefUnwindSafe,
impl<'a, Tag> Send for Item<'a, Tag>where
Tag: Send,
impl<'a, Tag> Sync for Item<'a, Tag>where
Tag: Sync,
impl<'a, Tag> Unpin for Item<'a, Tag>where
Tag: Unpin,
impl<'a, Tag> UnwindSafe for Item<'a, Tag>where
Tag: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more