pub struct CodegenOptions {
pub single_quote: bool,
pub minify: bool,
pub ascii_only: bool,
pub comments: CommentOptions,
pub source_map_path: Option<PathBuf>,
pub indent_char: IndentChar,
pub indent_width: usize,
pub initial_indent: u32,
}Expand description
Codegen Options.
Fields§
§single_quote: boolUse single quotes instead of double quotes.
Default is false.
minify: boolRemove whitespace.
Default is false.
ascii_only: boolEscape non-ASCII characters in string literals, untagged template literals, regular expression literals and identifier names.
Uses \uXXXX for characters up to U+FFFF and \u{...} for higher code points.
Regular expressions use escaped UTF-16 surrogate pairs for higher code points instead;
escaping changes the observable RegExp.prototype.source value.
Code point escapes (\u{...}) require ES2015 or later; this option does not provide
ES5-compatible output.
Non-ASCII characters are left unescaped in tagged template quasis (whose raw text is observable), JSX names and text, JSX attribute strings, hashbangs and preserved comments. JavaScript expressions inside tagged templates and JSX are escaped normally.
Default is false.
comments: CommentOptionsPrint comments?
At present, only some leading comments are preserved.
Default is CommentOptions::default.
source_map_path: Option<PathBuf>Enable sourcemap.
The provided path sets the source field in the returned sourcemap.
Default is None - no sourcemap is produced.
indent_char: IndentCharIndentation character.
Default is IndentChar::Tab.
indent_width: usizeNumber of characters per indentation level.
Default is 1.
initial_indent: u32Initial indentation level for generated code.
Default is 0.
Implementations§
Trait Implementations§
Source§impl Clone for CodegenOptions
impl Clone for CodegenOptions
Source§impl Debug for CodegenOptions
impl Debug for CodegenOptions
Auto Trait Implementations§
impl Freeze for CodegenOptions
impl RefUnwindSafe for CodegenOptions
impl Send for CodegenOptions
impl Sync for CodegenOptions
impl Unpin for CodegenOptions
impl UnsafeUnpin for CodegenOptions
impl UnwindSafe for CodegenOptions
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> 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