pub enum Trivia {
Comment(Comment),
BlankLine,
}Expand description
Trivia: comments and blank lines that appear between statements.
Trivia is used to preserve whitespace and comments for round-trip formatting.
Variants§
Comment(Comment)
A comment (line or block)
BlankLine
A blank line (empty line separating statements)
Implementations§
Source§impl Trivia
impl Trivia
Sourcepub fn line_comment(s: impl Into<String>) -> Self
pub fn line_comment(s: impl Into<String>) -> Self
Create a line comment trivia.
Sourcepub fn block_comment(s: impl Into<String>) -> Self
pub fn block_comment(s: impl Into<String>) -> Self
Create a block comment trivia.
Sourcepub fn blank_line() -> Self
pub fn blank_line() -> Self
Create a blank line trivia.
Trait Implementations§
impl Eq for Trivia
impl StructuralPartialEq for Trivia
Auto Trait Implementations§
impl Freeze for Trivia
impl RefUnwindSafe for Trivia
impl Send for Trivia
impl Sync for Trivia
impl Unpin for Trivia
impl UnwindSafe for Trivia
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.