pub struct Dumper<'a> {
current_indent: usize,
writer: Box<dyn Write + 'a>,
indent: Option<usize>,
max_line_width: usize,
current_line_width: usize,
}
Available on crate feature
artemis
only.Expand description
A dumper for Artemis AST scripts.
Fields§
§current_indent: usize
§writer: Box<dyn Write + 'a>
§indent: Option<usize>
§max_line_width: usize
§current_line_width: usize
Implementations§
Source§impl<'a> Dumper<'a>
impl<'a> Dumper<'a>
Sourcepub fn new<W: Write + 'a>(writer: W) -> Self
pub fn new<W: Write + 'a>(writer: W) -> Self
Creates a new Dumper with the specified writer.
default indent size is 4 spaces, and max line width is 100 characters.
Sourcepub fn set_indent(&mut self, indent: usize)
pub fn set_indent(&mut self, indent: usize)
Sets the indent size for the dumper.
Sourcepub fn set_no_indent(&mut self)
pub fn set_no_indent(&mut self)
Disables indentation for the dumper.
Sourcepub fn set_max_line_width(&mut self, max_line_width: usize)
pub fn set_max_line_width(&mut self, max_line_width: usize)
Sets the maximum line width for the dumper.
fn dump_f64(&mut self, f: &f64) -> Result<()>
fn dump_value(&mut self, v: &Value) -> Result<()>
fn dump_indent(&mut self) -> Result<()>
fn dump_value_in_one(&mut self, v: &Value) -> Result<()>
Auto Trait Implementations§
impl<'a> Freeze for Dumper<'a>
impl<'a> !RefUnwindSafe for Dumper<'a>
impl<'a> !Send for Dumper<'a>
impl<'a> !Sync for Dumper<'a>
impl<'a> Unpin for Dumper<'a>
impl<'a> !UnwindSafe for Dumper<'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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more