pub struct JsPrettyPrinter {
pub indent_width: usize,
pub line_width: usize,
pub trailing_commas: bool,
}Expand description
Pretty-prints a JsModule with configurable indentation and line width.
Fields§
§indent_width: usizeIndentation width (spaces per level).
line_width: usizeTarget line width (for soft wrapping heuristics).
trailing_commas: boolWhether to emit trailing commas in objects/arrays.
Implementations§
Source§impl JsPrettyPrinter
impl JsPrettyPrinter
Sourcepub fn print_module(&self, module: &JsModule) -> String
pub fn print_module(&self, module: &JsModule) -> String
Pretty-print a JsModule.
Sourcepub fn print_function(&self, func: &JsFunction) -> String
pub fn print_function(&self, func: &JsFunction) -> String
Pretty-print a single JsFunction.
Sourcepub fn print_expr(&self, expr: &JsExpr, _depth: usize) -> String
pub fn print_expr(&self, expr: &JsExpr, _depth: usize) -> String
Pretty-print a JsExpr at the given indentation depth.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsPrettyPrinter
impl RefUnwindSafe for JsPrettyPrinter
impl Send for JsPrettyPrinter
impl Sync for JsPrettyPrinter
impl Unpin for JsPrettyPrinter
impl UnsafeUnpin for JsPrettyPrinter
impl UnwindSafe for JsPrettyPrinter
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