pub trait ToDocument<P: ?Sized, A> {
// Required method
fn to_document(&self, printer: &P) -> DocBuilder<A>;
}Expand description
Convert a value into a document using the supplied printer.
This is the primary trait invoked throughout the pretty-printing pipeline;
it mirrors pretty::Pretty::pretty while giving access to printer-specific
context.
Required Methods§
Sourcefn to_document(&self, printer: &P) -> DocBuilder<A>
fn to_document(&self, printer: &P) -> DocBuilder<A>
Produce a document using the provided printer reference.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<A, P, T: ToDocument<P, A>> ToDocument<P, A> for Box<T>
impl<A, P, T: ToDocument<P, A>> ToDocument<P, A> for Box<T>
fn to_document(&self, printer: &P) -> DocBuilder<A>
Source§impl<A, P, T: ToDocument<P, A>> ToDocument<P, A> for Option<T>
impl<A, P, T: ToDocument<P, A>> ToDocument<P, A> for Option<T>
fn to_document(&self, printer: &P) -> DocBuilder<A>
Source§impl<A, P> ToDocument<P, A> for String
impl<A, P> ToDocument<P, A> for String
fn to_document(&self, _printer: &P) -> DocBuilder<A>
Source§impl<A: 'static + Clone> ToDocument<LeanPrinter, A> for (Vec<GenericParam>, &TraitItem)
impl<A: 'static + Clone> ToDocument<LeanPrinter, A> for (Vec<GenericParam>, &TraitItem)
fn to_document(&self, printer: &LeanPrinter) -> DocBuilder<A>
Source§impl<A: 'static + Clone> ToDocument<LeanPrinter, A> for Vec<Param>
Render parameters, adding a line after each parameter
impl<A: 'static + Clone> ToDocument<LeanPrinter, A> for Vec<Param>
Render parameters, adding a line after each parameter