pub enum PreToken {
BlankLine,
LineEnd,
WordEnd,
IndentStart,
IndentEnd,
LineSpacingPolicy(TriviaBlankLineSpacingPolicy),
Literal(Rc<String>, SyntaxKind),
Trivia(Trivia),
TempIndentStart,
TempIndentEnd,
}Expand description
A token that can be written by elements.
These are tokens that are intended to be written directly by elements to a
TokenStream consisting of PreTokens. Note that
this will transformed into a TokenStream of
PostTokens by a
Postprocessor (authors of elements are never
expected to write PostTokens directly).
Variants§
BlankLine
A blank line.
LineEnd
The end of a line.
WordEnd
The end of a word.
IndentStart
The start of an indented block.
IndentEnd
The end of an indented block.
LineSpacingPolicy(TriviaBlankLineSpacingPolicy)
How to handle trivial blank lines from this point onwards.
Literal(Rc<String>, SyntaxKind)
Literal text.
Trivia(Trivia)
Trivia.
TempIndentStart
A temporary indent start. Used in command section formatting.
TempIndentEnd
A temporary indent end. Used in command section formatting.
Trait Implementations§
impl Eq for PreToken
impl StructuralPartialEq for PreToken
Auto Trait Implementations§
impl Freeze for PreToken
impl RefUnwindSafe for PreToken
impl !Send for PreToken
impl !Sync for PreToken
impl Unpin for PreToken
impl UnwindSafe for PreToken
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<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