pub struct DebugDoc {
pub inner: Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>,
}
Fields
inner: Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
Implementations
sourceimpl DebugDoc
impl DebugDoc
sourcepub fn new(
inner: Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
) -> Self
pub fn new(
inner: Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
) -> Self
Constructs a new DebugDoc
.
Methods from Deref<Target = Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>>
sourcepub fn render<'b, W>(&'b self, width: usize, out: &mut W) -> Result<(), Error> where
T: Deref<Target = Doc<'b, T, A>>,
W: Write + ?Sized,
pub fn render<'b, W>(&'b self, width: usize, out: &mut W) -> Result<(), Error> where
T: Deref<Target = Doc<'b, T, A>>,
W: Write + ?Sized,
Writes a rendered document to a std::io::Write
object.
sourcepub fn render_fmt<'b, W>(
&'b self,
width: usize,
out: &mut W
) -> Result<(), Error> where
T: Deref<Target = Doc<'b, T, A>>,
W: Write + ?Sized,
pub fn render_fmt<'b, W>(
&'b self,
width: usize,
out: &mut W
) -> Result<(), Error> where
T: Deref<Target = Doc<'b, T, A>>,
W: Write + ?Sized,
Writes a rendered document to a std::fmt::Write
object.
sourcepub fn render_raw<'b, W>(
&'b self,
width: usize,
out: &mut W
) -> Result<(), <W as Render>::Error> where
T: Deref<Target = Doc<'b, T, A>>,
W: RenderAnnotated<A> + ?Sized,
pub fn render_raw<'b, W>(
&'b self,
width: usize,
out: &mut W
) -> Result<(), <W as Render>::Error> where
T: Deref<Target = Doc<'b, T, A>>,
W: RenderAnnotated<A> + ?Sized,
Writes a rendered document to a RenderAnnotated<A>
object.
sourcepub fn pretty<'b>(&'b self, width: usize) -> Pretty<'b, T, A> where
T: Deref<Target = Doc<'b, T, A>>,
pub fn pretty<'b>(&'b self, width: usize) -> Pretty<'b, T, A> where
T: Deref<Target = Doc<'b, T, A>>,
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");
Trait Implementations
sourceimpl Deref for DebugDoc
impl Deref for DebugDoc
type Target = Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
type Target = Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
The resulting type after dereferencing.
sourceimpl From<DebugDoc> for Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
impl From<DebugDoc> for Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
sourcefn from(
input: DebugDoc
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn from(
input: DebugDoc
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
Performs the conversion.
sourceimpl Ord for DebugDoc
impl Ord for DebugDoc
sourceimpl PartialOrd<DebugDoc> for DebugDoc
impl PartialOrd<DebugDoc> for DebugDoc
sourcefn partial_cmp(&self, other: &DebugDoc) -> Option<Ordering>
fn partial_cmp(&self, other: &DebugDoc) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl PrettyDebug for DebugDoc
impl PrettyDebug for DebugDoc
fn pretty(&self) -> DebugDocBuilder
fn to_doc(&self) -> DebugDoc
fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn pretty_builder(&self) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
sourcefn display(&self) -> String
fn display(&self) -> String
A convenience method that prints out the document without colors in 70 columns. Generally, you should use plain_string or colored_string if possible, but display() can be useful for trace lines and things like that, where you don’t have control over the terminal. Read more
fn plain_string(&self, width: usize) -> String
fn colored_string(&self, width: usize) -> String
impl Eq for DebugDoc
impl StructuralEq for DebugDoc
impl StructuralPartialEq for DebugDoc
Auto Trait Implementations
impl RefUnwindSafe for DebugDoc
impl Send for DebugDoc
impl Sync for DebugDoc
impl Unpin for DebugDoc
impl UnwindSafe for DebugDoc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more