[−][src]Trait shoebill::Doclike
Trait that defines items we can treat as Doc elements. We can use methods like alloc, concat, group, nest, etc. directly on types implementing Doclike.
Required methods
fn alloc(self, pr: &mut P) -> DocPtr<'p>
Generic over any Doclike, so you can use this for text as well.
Provided methods
fn concat(self, other: impl Doclike<'p, P>, pr: &mut P) -> DocPtr<'p>
fn nest(self, amt: u32, pr: &mut P) -> DocPtr<'p>
fn nest_line(
self,
other: impl Doclike<'p, P>,
amt: u32,
pr: &mut P
) -> DocPtr<'p>
self,
other: impl Doclike<'p, P>,
amt: u32,
pr: &mut P
) -> DocPtr<'p>
fn nest_doc(
self,
other: impl Doclike<'p, P>,
amt: u32,
pr: &mut P
) -> DocPtr<'p>
self,
other: impl Doclike<'p, P>,
amt: u32,
pr: &mut P
) -> DocPtr<'p>
fn nest_doc_zero(
self,
other: impl Doclike<'p, P>,
amt: u32,
pr: &mut P
) -> DocPtr<'p>
self,
other: impl Doclike<'p, P>,
amt: u32,
pr: &mut P
) -> DocPtr<'p>
fn group(self, pr: &mut P) -> DocPtr<'p>
Implementors
impl<'p, A, P: HasPrinter<'p>> Doclike<'p, P> for A where
Cow<'p, str>: From<A>,
[src]
Cow<'p, str>: From<A>,
Anything that can be turned into a Cow string (a CowStr, a string slice, or an owned string) is Doclike.
impl<'p, P: HasPrinter<'p>> Doclike<'p, P> for Doc<'p>
[src]
impl<'p, P: HasPrinter<'p>> Doclike<'p, P> for StrOrDoc<'p>
[src]
StrOrDoc is doclike; in the case of a doc, you just get the doc back. In the case of a Cow string, we allocate defer to the implementation that's generic over any A such that A can become a Cow string