Struct pretty::BoxDoc
[−]
[src]
pub struct BoxDoc<'a, A>(_);
Methods from Deref<Target = Doc<'a, A, BoxDoc<'a, A>>>
pub fn render<'b, W: ?Sized>(&'b self, width: usize, out: &mut W) -> Result<()> where
B: Deref<Target = Doc<'b, A, B>>,
W: Write,
[src]
B: Deref<Target = Doc<'b, A, B>>,
W: Write,
Writes a rendered document to a std::io::Write
object.
pub fn render_fmt<'b, W: ?Sized>(&'b self, width: usize, out: &mut W) -> Result where
B: Deref<Target = Doc<'b, A, B>>,
W: Write,
[src]
B: Deref<Target = Doc<'b, A, B>>,
W: Write,
Writes a rendered document to a std::fmt::Write
object.
pub fn pretty<'b>(&'b self, width: usize) -> Pretty<'b, A, B> where
B: Deref<Target = Doc<'b, A, B>>,
[src]
B: Deref<Target = Doc<'b, A, B>>,
Returns a value which implements std::fmt::Display
use pretty::Doc; let doc = Doc::<(), _>::group( Doc::text("hello").append(Doc::space()).append(Doc::text("world")) ); assert_eq!(format!("{}", doc.pretty(80)), "hello world");
pub fn render_colored<'b, W>(&'b self, width: usize, out: W) -> Result<()> where
B: Deref<Target = Doc<'b, ColorSpec, B>>,
W: WriteColor,
[src]
B: Deref<Target = Doc<'b, ColorSpec, B>>,
W: WriteColor,
Trait Implementations
impl<'a, A: Clone> Clone for BoxDoc<'a, A>
[src]
fn clone(&self) -> BoxDoc<'a, A>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, A: Eq> Eq for BoxDoc<'a, A>
[src]
impl<'a, A: Ord> Ord for BoxDoc<'a, A>
[src]
fn cmp(&self, __arg_0: &BoxDoc<'a, A>) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<'a, A: PartialEq> PartialEq for BoxDoc<'a, A>
[src]
fn eq(&self, __arg_0: &BoxDoc<'a, A>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &BoxDoc<'a, A>) -> bool
[src]
This method tests for !=
.
impl<'a, A: PartialOrd> PartialOrd for BoxDoc<'a, A>
[src]
fn partial_cmp(&self, __arg_0: &BoxDoc<'a, A>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &BoxDoc<'a, A>) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &BoxDoc<'a, A>) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &BoxDoc<'a, A>) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &BoxDoc<'a, A>) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, A> Debug for BoxDoc<'a, A> where
A: Debug,
[src]
A: Debug,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more