Struct Indent
pub struct Indent<'f, F, I = &'static str>{
indent: I,
needs_indent: bool,
f: &'f mut F,
}Expand description
Pads text with leading indentation after every newline
Fields§
§indent: I§needs_indent: bool§f: &'f mut FImplementations§
Trait Implementations§
Auto Trait Implementations§
impl<'f, F, I = &'static str> !UnwindSafe for Indent<'f, F, I>
impl<'f, F, I> Freeze for Indent<'f, F, I>
impl<'f, F, I> RefUnwindSafe for Indent<'f, F, I>
impl<'f, F, I> Send for Indent<'f, F, I>
impl<'f, F, I> Sync for Indent<'f, F, I>
impl<'f, F, I> Unpin for Indent<'f, F, I>
impl<'f, F, I> UnsafeUnpin for Indent<'f, F, I>where
I: UnsafeUnpin,
F: ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<W> FmtAdapter for W
impl<W> FmtAdapter for W
§fn indent_with<I>(&mut self, indent: I) -> Indent<'_, Self, I>where
I: Display,
fn indent_with<I>(&mut self, indent: I) -> Indent<'_, Self, I>where
I: Display,
Pastes
indent after each newline.§fn delimit<O, E>(&mut self, open: O, close: E) -> Delimit<'_, Self, E>
fn delimit<O, E>(&mut self, open: O, close: E) -> Delimit<'_, Self, E>
Delimits a section with
open and close.§fn delimit_indented<O, E>(
&mut self,
open: O,
close: E,
) -> DelimitIndent<'_, Self, E>
fn delimit_indented<O, E>( &mut self, open: O, close: E, ) -> DelimitIndent<'_, Self, E>
Delimits a section with
open and close, raising the indent level within.§fn list<Iter, Sep>(&mut self, items: Iter, sep: Sep) -> Result<(), Error>
fn list<Iter, Sep>(&mut self, items: Iter, sep: Sep) -> Result<(), Error>
Formats bracketed lists of the kind (Item (Comma Item)*)?
§fn list_wrap<Iter, Sep, O, E>(
&mut self,
open: O,
items: Iter,
sep: Sep,
close: E,
) -> Result<(), Error>where
Iter: IntoIterator,
<Iter as IntoIterator>::Item: Display,
Sep: Display,
O: Display,
E: Display,
fn list_wrap<Iter, Sep, O, E>(
&mut self,
open: O,
items: Iter,
sep: Sep,
close: E,
) -> Result<(), Error>where
Iter: IntoIterator,
<Iter as IntoIterator>::Item: Display,
Sep: Display,
O: Display,
E: Display,
Wraps a list in
open and close.
This differs from FmtAdapter::delimit because it prints nothing
if the list is empty.