pub trait Print {
// Required methods
fn print_final_trivia(&self) -> String;
fn print_without_final_trivia(&self) -> String;
// Provided method
fn print(&self) -> String { ... }
}Expand description
A trait to print the token as-is, while preserving all user spaces, comments and styling.
Required Methods§
Sourcefn print_final_trivia(&self) -> String
fn print_final_trivia(&self) -> String
Prints only the very final trivia. Used for the default implementation of
Print::print, which just joins Print::print_without_final_trivia
and this function.
Sourcefn print_without_final_trivia(&self) -> String
fn print_without_final_trivia(&self) -> String
Prints the whole token including all surrounding trivia, excluding the very last trailing trivia.