Skip to main content

ToDocumentOwned

Trait ToDocumentOwned 

Source
pub trait ToDocumentOwned<P, A> {
    // Required method
    fn to_document_owned(self, printer: &P) -> DocBuilder<A>;
}
Expand description

Convert a value into a document by-value.

Implementations typically delegate to ToDocument after adjusting the input ownership (e.g., cloning or borrowing). It allows helpers to accept either borrowed or owned values transparently.

Required Methods§

Source

fn to_document_owned(self, printer: &P) -> DocBuilder<A>

Produce a document using the provided printer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<P, A, T: ToDocument<P, A>> ToDocumentOwned<P, A> for &T

Source§

fn to_document_owned(self, printer: &P) -> DocBuilder<A>

Source§

impl<P, A> ToDocumentOwned<P, A> for &str

Source§

fn to_document_owned(self, _printer: &P) -> DocBuilder<A>

Source§

impl<P, A> ToDocumentOwned<P, A> for Option<&str>

Source§

fn to_document_owned(self, printer: &P) -> DocBuilder<A>

Source§

impl<P, A> ToDocumentOwned<P, A> for String

Source§

fn to_document_owned(self, _printer: &P) -> DocBuilder<A>

Implementors§

Source§

impl<P, A> ToDocumentOwned<P, A> for DocBuilder<A>