Struct interoptopus::writer::IndentWriter
source · pub struct IndentWriter<'a> { /* private fields */ }
Expand description
Convenience helper to allow backends to write code with indentation.
Implementations§
source§impl<'a> IndentWriter<'a>
impl<'a> IndentWriter<'a>
pub fn indent(&mut self)
pub fn unindent(&mut self)
pub fn new(writer: &'a mut dyn Write) -> Self
pub fn with_indent(writer: &'a mut dyn Write, one_indent: &str) -> Self
pub fn indented( &mut self, f: impl FnOnce(&mut dyn Write) -> Result<()> ) -> Result<(), Error>
pub fn unindented( &mut self, f: impl FnOnce(&mut dyn Write) -> Result<()> ) -> Result<(), Error>
pub fn indented_block( &mut self, block: Option<(&str, &str)>, f: impl FnOnce(&mut Self) -> Result<(), Error> ) -> Result<(), Error>
pub fn writer(&mut self) -> &mut dyn Write
pub fn newline(&mut self) -> Result<(), Error>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for IndentWriter<'a>
impl<'a> !Send for IndentWriter<'a>
impl<'a> !Sync for IndentWriter<'a>
impl<'a> Unpin for IndentWriter<'a>
impl<'a> !UnwindSafe for IndentWriter<'a>
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