#[non_exhaustive]pub struct Config {
pub target: EsVersion,
pub ascii_only: bool,
pub minify: bool,
pub omit_last_semi: bool,
pub emit_assert_for_import_attributes: bool,
pub inline_script: bool,
pub reduce_escaped_newline: bool,
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.target: EsVersion
The target runtime environment.
This defaults to EsVersion::latest because it preserves input as much as possible.
Note: This does not verifies if output is valid for the target runtime.
e.g. const foo = 1;
with EsVersion::Es3 will emitted as const foo = 1
without verification.
This is because it’s not a concern of the code generator.
ascii_only: bool
Forces the code generator to use only ascii characters.
This is useful for environments that do not support unicode.
minify: bool
§omit_last_semi: bool
If true, the code generator will emit the lastest semicolon.
Defaults to false
.
emit_assert_for_import_attributes: bool
§inline_script: bool
§reduce_escaped_newline: bool
Transform escaped newline '\n'
of TplElement
to a newline character
to reduce text size of javascript code
Defaults to true
Implementations§
Source§impl Config
impl Config
pub fn with_target(self, target: EsVersion) -> Self
pub fn with_minify(self, minify: bool) -> Self
pub fn with_ascii_only(self, ascii_only: bool) -> Self
pub fn with_omit_last_semi(self, omit_last_semi: bool) -> Self
pub fn with_emit_assert_for_import_attributes( self, emit_assert_for_import_attributes: bool, ) -> Self
pub fn with_inline_script(self, inline_script: bool) -> Self
Sourcepub fn with_reduce_escaped_newline(self, reduce_escaped_newline: bool) -> Self
pub fn with_reduce_escaped_newline(self, reduce_escaped_newline: bool) -> Self
Transform escaped newline '\n'
of TplElement
to a newline character
to reduce text size of javascript code
Defaults to true
Trait Implementations§
impl Copy for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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