pub struct TokenPrinter { /* private fields */ }Expand description
A pretty printer that works with PrettyToken streams.
Implementations§
Source§impl TokenPrinter
impl TokenPrinter
Sourcepub fn new(config: PrettyConfig) -> Self
pub fn new(config: PrettyConfig) -> Self
Creates a new token printer.
Sourcepub fn with_colors(self, scheme: ColorScheme) -> Self
pub fn with_colors(self, scheme: ColorScheme) -> Self
Sets the color scheme.
Sourcepub fn render(&self, tokens: &[PrettyToken]) -> String
pub fn render(&self, tokens: &[PrettyToken]) -> String
Renders a slice of tokens to a String.
Sourcepub fn render_wrapped(&self, tokens: &[PrettyToken]) -> String
pub fn render_wrapped(&self, tokens: &[PrettyToken]) -> String
Renders with line wrapping at config.width.
Auto Trait Implementations§
impl Freeze for TokenPrinter
impl RefUnwindSafe for TokenPrinter
impl Send for TokenPrinter
impl Sync for TokenPrinter
impl Unpin for TokenPrinter
impl UnsafeUnpin for TokenPrinter
impl UnwindSafe for TokenPrinter
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