#[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,
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
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
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
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
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