Skip to main content

install_pretty_helpers

Macro install_pretty_helpers 

Source
macro_rules! install_pretty_helpers {
    ($allocator:ident : $allocator_type:ty) => { ... };
    (@$allocator:ident, $($(#[$($attrs:tt)*])*$name:ident{$($callable:tt)*}),*) => { ... };
}
Expand description

Install pretty-printing helpers partially applied with a given local allocator.

This macro declares a set of small, local macros that proxy to the underlying pretty::DocAllocator methods and macro while capturing your allocator value. It keeps printing code concise and avoids passing the allocator around explicitly.

§Syntax

install_pretty_helpers!(alloc_ident: AllocatorType)
  • alloc_ident: the in-scope variable that implements both pretty::DocAllocator and Printer.
  • AllocatorType: the concrete type of that variable.

§What gets installed