Struct swc_ecma_codegen::text_writer::JsWriter[][src]

pub struct JsWriter<'a, W: Write> { /* fields omitted */ }
Expand description

Ported from createTextWriter of the typescript compiler.

https://github.com/Microsoft/TypeScript/blob/45eaf42006/src/compiler/utilities.ts#L2548

Implementations

impl<'a, W: Write> JsWriter<'a, W>[src]

pub fn new(
    cm: Lrc<SourceMap>,
    new_line: &'a str,
    wr: W,
    srcmap: Option<&'a mut Vec<(BytePos, LineCol)>>
) -> Self
[src]

pub fn with_target(
    cm: Lrc<SourceMap>,
    new_line: &'a str,
    wr: W,
    srcmap: Option<&'a mut Vec<(BytePos, LineCol)>>,
    target: JscTarget
) -> Self
[src]

Trait Implementations

impl<'a, W: Write> WriteJs for JsWriter<'a, W>[src]

fn increase_indent(&mut self) -> Result[src]

fn decrease_indent(&mut self) -> Result[src]

fn write_semi(&mut self) -> Result[src]

This may write semicolon.

fn write_space(&mut self) -> Result[src]

fn write_keyword(&mut self, span: Option<Span>, s: &'static str) -> Result[src]

fn write_operator(&mut self, s: &str) -> Result[src]

fn write_param(&mut self, s: &str) -> Result[src]

fn write_property(&mut self, s: &str) -> Result[src]

fn write_line(&mut self) -> Result[src]

fn write_lit(&mut self, span: Span, s: &str) -> Result[src]

fn write_comment(&mut self, span: Span, s: &str) -> Result[src]

fn write_str_lit(&mut self, span: Span, s: &str) -> Result[src]

fn write_str(&mut self, s: &str) -> Result[src]

fn write_symbol(&mut self, span: Span, s: &str) -> Result[src]

fn write_punct(&mut self, s: &'static str) -> Result[src]

fn target(&self) -> JscTarget[src]

Returns javascript target which should be used while generating code. Read more

Auto Trait Implementations

impl<'a, W> !RefUnwindSafe for JsWriter<'a, W>

impl<'a, W> !Send for JsWriter<'a, W>

impl<'a, W> !Sync for JsWriter<'a, W>

impl<'a, W> Unpin for JsWriter<'a, W> where
    W: Unpin

impl<'a, W> !UnwindSafe for JsWriter<'a, W>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> Node for T where
    T: Any + ?Sized

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]