Trait pretty::DocAllocator [] [src]

pub trait DocAllocator<'a> {
    type Doc: Deref<Target = Doc<'a, Self::Doc>> + Clone;
    fn alloc(&'a self, _: Doc<'a, Self::Doc>) -> Self::Doc;

    fn nil(&'a self) -> DocBuilder<'a, Self> { ... }
fn newline(&'a self) -> DocBuilder<'a, Self> { ... }
fn space(&'a self) -> DocBuilder<'a, Self> { ... }
fn as_string<T: ToString>(&'a self, t: T) -> DocBuilder<'a, Self> { ... }
fn text<T: Into<Cow<'a, str>>>(&'a self, data: T) -> DocBuilder<'a, Self> { ... }
fn concat<I>(&'a self, docs: I) -> DocBuilder<'a, Self>
    where
        I: IntoIterator,
        I::Item: Into<Doc<'a, Self::Doc>>
, { ... } }

The DocAllocator trait abstracts over a type which can allocate (pointers to) Doc.

Associated Types

Required Methods

Provided Methods

Implementors