[][src]Struct pretty::RefDoc

pub struct RefDoc<'a, A = ()>(pub &'a Doc<'a, RefDoc<'a, A>, A>);

Newtype wrapper for &Doc

Methods from Deref<Target = Doc<'a, RefDoc<'a, A>, A>>

pub fn render<W: ?Sized>(&self, width: usize, out: &mut W) -> Result<()> where
    W: Write
[src]

Writes a rendered document to a std::io::Write object.

pub fn render_fmt<W: ?Sized>(&self, width: usize, out: &mut W) -> Result where
    W: Write
[src]

Writes a rendered document to a std::fmt::Write object.

pub fn render_raw<W: ?Sized>(
    &self,
    width: usize,
    out: &mut W
) -> Result<(), W::Error> where
    W: RenderAnnotated<A>, 
[src]

Writes a rendered document to a RenderAnnotated<A> object.

pub fn pretty<'d>(&'d self, width: usize) -> Pretty<'a, 'd, T, A>[src]

Returns a value which implements std::fmt::Display

use pretty::{Doc, BoxDoc};
let doc = BoxDoc::<()>::group(
    BoxDoc::text("hello").append(Doc::line()).append(Doc::text("world"))
);
assert_eq!(format!("{}", doc.pretty(80)), "hello world");

pub fn render_colored<W>(&self, width: usize, out: W) -> Result<()> where
    W: WriteColor, 
[src]

Trait Implementations

impl<'_, A> Clone for RefDoc<'_, A>[src]

impl<'_, A> Copy for RefDoc<'_, A>[src]

impl<'a, A> Debug for RefDoc<'a, A> where
    A: Debug
[src]

impl<'a, A> Deref for RefDoc<'a, A>[src]

type Target = Doc<'a, RefDoc<'a, A>, A>

The resulting type after dereferencing.

impl<'a, A> DocPtr<'a, A> for RefDoc<'a, A>[src]

type ColumnFn = &'a (dyn Fn(usize) -> Self + 'a)

type WidthFn = &'a (dyn Fn(isize) -> Self + 'a)

impl<'a, A> From<RefDoc<'a, A>> for BuildDoc<'a, RefDoc<'a, A>, A>[src]

Auto Trait Implementations

impl<'a, A = ()> !RefUnwindSafe for RefDoc<'a, A>

impl<'a, A = ()> !Send for RefDoc<'a, A>

impl<'a, A = ()> !Sync for RefDoc<'a, A>

impl<'a, A> Unpin for RefDoc<'a, A>

impl<'a, A = ()> !UnwindSafe for RefDoc<'a, A>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.