pub struct Writer<T: Write> { /* private fields */ }
Implementations
sourceimpl<T: Write> Writer<T>
impl<T: Write> Writer<T>
pub fn new(out: T) -> Self
pub fn write_part(&mut self, part: &ProgramPart) -> Result<(), IoError>
pub fn write_decl(&mut self, decl: &Declaration) -> Result<(), IoError>
pub fn write_variable_decls(
&mut self,
kind: &VariableKind,
decls: &[VariableDecl]
) -> Result<(), IoError>
pub fn write_class(&mut self, class: &Class) -> Result<(), IoError>
pub fn write_export_decl(&mut self, exp: &ModuleExport) -> Result<(), IoError>
pub fn write_all_export(&mut self, exp: &Literal) -> Result<(), IoError>
pub fn write_default_export(
&mut self,
exp: &DefaultExportDecl
) -> Result<(), IoError>
pub fn write_named_export(
&mut self,
exp: &NamedExportDecl
) -> Result<(), IoError>
pub fn write_export_specifiers(
&mut self,
specifiers: &[ExportSpecifier],
from: &Option<Literal>
) -> Result<(), IoError>
pub fn write_import_decl(&mut self, imp: &ModuleImport) -> Result<(), IoError>
pub fn write_import_specificer(
&mut self,
spec: &ImportSpecifier
) -> Result<(), IoError>
pub fn write_namespace_import(
&mut self,
name: &Identifier
) -> Result<(), IoError>
pub fn write_normal_import(
&mut self,
name: &Identifier,
local: &Option<Identifier>
) -> Result<(), IoError>
pub fn write_directive(&mut self, dir: &Directive) -> Result<(), IoError>
pub fn write_variable_decl(
&mut self,
decl: &VariableDecl
) -> Result<bool, IoError>
pub fn write_variable_kind(&mut self, kind: &VariableKind) -> Result<(), IoError>
pub fn write_stmt(&mut self, stmt: &Statement) -> Result<(), IoError>
pub fn write_debugger_stmt(&mut self) -> Result<(), IoError>
pub fn write_block_stmt(&mut self, block: &[ProgramPart]) -> Result<(), IoError>
pub fn write_with_stmt(&mut self, expr: &WithStatement) -> Result<(), IoError>
pub fn write_return_stmt(
&mut self,
expr: &Option<Expression>
) -> Result<(), IoError>
pub fn write_labeled_stmt(
&mut self,
expr: &LabeledStatement
) -> Result<(), IoError>
pub fn write_break_stmt(
&mut self,
expr: &Option<Identifier>
) -> Result<(), IoError>
pub fn write_continue_stmt(
&mut self,
expr: &Option<Identifier>
) -> Result<(), IoError>
pub fn write_if_stmt(&mut self, expr: &IfStatement) -> Result<(), IoError>
pub fn write_switch_stmt(
&mut self,
switch: &SwitchStatement
) -> Result<(), IoError>
pub fn write_switch_case(&mut self, case: &SwitchCase) -> Result<(), IoError>
pub fn write_throw_stmt(&mut self, expr: &Expression) -> Result<(), IoError>
pub fn write_try_stmt(&mut self, stmt: &TryStatement) -> Result<(), IoError>
pub fn write_while_stmt(
&mut self,
stmt: &WhileStatement
) -> Result<bool, IoError>
pub fn write_do_while_stmt(
&mut self,
stmt: &DoWhileStatement
) -> Result<(), IoError>
pub fn write_for_stmt(&mut self, stmt: &ForStatement) -> Result<bool, IoError>
pub fn write_loop_init(&mut self, init: &LoopInit) -> Result<(), IoError>
pub fn write_for_in_stmt(
&mut self,
stmt: &ForInStatement
) -> Result<bool, IoError>
pub fn write_for_of_stmt(
&mut self,
stmt: &ForOfStatement
) -> Result<bool, IoError>
pub fn write_loop_left(&mut self, left: &LoopLeft) -> Result<(), IoError>
pub fn write_var_stmt(&mut self, expr: &[VariableDecl]) -> Result<(), IoError>
pub fn write_pattern(&mut self, pattern: &Pattern) -> Result<(), IoError>
pub fn write_object_pattern(
&mut self,
obj: &ObjectPattern
) -> Result<(), IoError>
pub fn write_property(&mut self, prop: &Property) -> Result<(), IoError>
pub fn write_init_property(&mut self, prop: &Property) -> Result<(), IoError>
pub fn write_get_property(&mut self, prop: &Property) -> Result<(), IoError>
pub fn write_set_property(&mut self, prop: &Property) -> Result<(), IoError>
pub fn write_property_method(&mut self, prop: &Property) -> Result<(), IoError>
pub fn write_function_args(
&mut self,
args: &[FunctionArg]
) -> Result<(), IoError>
pub fn write_function_arg(&mut self, arg: &FunctionArg) -> Result<(), IoError>
pub fn write_function_body(&mut self, body: &FunctionBody) -> Result<(), IoError>
pub fn write_ctor_property(&mut self, prop: &Property) -> Result<(), IoError>
pub fn write_property_key(
&mut self,
key: &PropertyKey,
computed: bool
) -> Result<(), IoError>
pub fn write_property_value(
&mut self,
value: &PropertyValue
) -> Result<(), IoError>
pub fn write_rest_pattern_part(&mut self, pat: &Pattern) -> Result<(), IoError>
pub fn write_array_pattern(
&mut self,
arr: &[Option<Pattern>]
) -> Result<(), IoError>
pub fn write_rest_element(&mut self, pat: &Pattern) -> Result<(), IoError>
pub fn write_assignment_pattern(
&mut self,
assignment: &AssignmentPattern
) -> Result<(), IoError>
pub fn write_expr(&mut self, expr: &Expression) -> Result<(), IoError>
pub fn write_this_expr(&mut self) -> Result<(), IoError>
pub fn write_super_expr(&mut self) -> Result<(), IoError>
pub fn write_array_expr(&mut self, arr: &ArrayExpression) -> Result<(), IoError>
pub fn write_object_expr(
&mut self,
obj: &ObjectExpression
) -> Result<(), IoError>
pub fn write_function(&mut self, func: &Function) -> Result<(), IoError>
pub fn write_unary_expr(
&mut self,
unary: &UnaryExpression
) -> Result<(), IoError>
pub fn write_unary_operator(&mut self, op: &UnaryOperator) -> Result<(), IoError>
pub fn write_update_expr(
&mut self,
update: &UpdateExpression
) -> Result<(), IoError>
pub fn write_update_operator(
&mut self,
op: &UpdateOperator
) -> Result<(), IoError>
pub fn write_binary_expr(
&mut self,
binary: &BinaryExpression
) -> Result<(), IoError>
pub fn write_binary_operator(
&mut self,
op: &BinaryOperator
) -> Result<(), IoError>
pub fn write_assignment_expr(
&mut self,
assignment: &AssignmentExpression
) -> Result<(), IoError>
pub fn write_assignment_operator(
&mut self,
op: &AssignmentOperator
) -> Result<(), IoError>
pub fn write_logical_expr(
&mut self,
logical: &LogicalExpression
) -> Result<(), IoError>
pub fn write_logical_operator(
&mut self,
op: &LogicalOperator
) -> Result<(), IoError>
pub fn write_member_expr(
&mut self,
member: &MemberExpression
) -> Result<(), IoError>
pub fn write_conditional_expr(
&mut self,
conditional: &ConditionalExpression
) -> Result<(), IoError>
pub fn write_call_expr(&mut self, call: &CallExpression) -> Result<(), IoError>
pub fn write_new_expr(&mut self, new: &NewExpression) -> Result<(), IoError>
pub fn write_sequence_expr(
&mut self,
sequence: &[Expression]
) -> Result<(), IoError>
pub fn write_spread_expr(&mut self, spread: &Expression) -> Result<(), IoError>
pub fn write_arrow_function_expr(
&mut self,
func: &ArrowFunctionExpression
) -> Result<(), IoError>
pub fn write_yield_expr(&mut self, expr: &YieldExpression) -> Result<(), IoError>
pub fn write_meta_property(&mut self, meta: &MetaProperty) -> Result<(), IoError>
pub fn write_await_expr(&mut self, expr: &Expression) -> Result<(), IoError>
pub fn write_ident(&mut self, ident: &str) -> Result<(), IoError>
pub fn write_tagged_template(
&mut self,
template: &TaggedTemplateExpression
) -> Result<(), IoError>
pub fn write_literal(&mut self, lit: &Literal) -> Result<(), IoError>
pub fn write_bool(&mut self, boolean: bool) -> Result<(), IoError>
pub fn write_string(&mut self, s: &str) -> Result<(), IoError>
pub fn write_regex(&mut self, regex: &RegEx) -> Result<(), IoError>
pub fn write_template(
&mut self,
template: &TemplateLiteral
) -> Result<(), IoError>
pub fn write_empty_stmt(&mut self) -> Result<(), IoError>
pub fn write_open_brace(&mut self) -> Result<(), IoError>
pub fn write_close_brace(&mut self) -> Result<(), IoError>
pub fn write_leading_whitespace(&mut self) -> Result<(), IoError>
pub fn write_new_line(&mut self) -> Result<(), IoError>
Auto Trait Implementations
impl<T> RefUnwindSafe for Writer<T>where
T: RefUnwindSafe,
impl<T> Send for Writer<T>where
T: Send,
impl<T> Sync for Writer<T>where
T: Sync,
impl<T> Unpin for Writer<T>where
T: Unpin,
impl<T> UnwindSafe for Writer<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more