Struct DelimitIndent
pub struct DelimitIndent<'f, F, E = &'static str>{
f: Indent<'f, F>,
close: E,
}Expand description
Prints delimiters around anything formatted with this. Implies Indent
Fields§
§f: Indent<'f, F>§close: EImplementations§
§impl<F, E> DelimitIndent<'_, F, E>
impl<F, E> DelimitIndent<'_, F, E>
§impl<'f, F, E> DelimitIndent<'f, F, E>
impl<'f, F, E> DelimitIndent<'f, F, E>
pub fn new<O>(f: &'f mut F, open: O, close: E) -> DelimitIndent<'f, F, E>where
O: Display,
Trait Implementations§
§impl<F, E> Drop for DelimitIndent<'_, F, E>
impl<F, E> Drop for DelimitIndent<'_, F, E>
Auto Trait Implementations§
impl<'f, F, E = &'static str> !UnwindSafe for DelimitIndent<'f, F, E>
impl<'f, F, E> Freeze for DelimitIndent<'f, F, E>
impl<'f, F, E> RefUnwindSafe for DelimitIndent<'f, F, E>
impl<'f, F, E> Send for DelimitIndent<'f, F, E>
impl<'f, F, E> Sync for DelimitIndent<'f, F, E>
impl<'f, F, E> Unpin for DelimitIndent<'f, F, E>
impl<'f, F, E> UnsafeUnpin for DelimitIndent<'f, F, E>where
E: 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.