pub struct JsModuleBuilder { /* private fields */ }Expand description
Builder for JavaScript modules.
Implementations§
Source§impl JsModuleBuilder
impl JsModuleBuilder
Sourcepub fn metadata(self, metadata: GenerationMetadata) -> Self
pub fn metadata(self, metadata: GenerationMetadata) -> Self
Set generation metadata for immutability tracking.
Sourcepub fn stmts(self, stmts: impl IntoIterator<Item = Stmt>) -> Self
pub fn stmts(self, stmts: impl IntoIterator<Item = Stmt>) -> Self
Add multiple statements.
Sourcepub fn let_decl(self, name: impl Into<String>, value: Expr) -> Result<Self>
pub fn let_decl(self, name: impl Into<String>, value: Expr) -> Result<Self>
Add a let declaration.
Sourcepub fn const_decl(self, name: impl Into<String>, value: Expr) -> Result<Self>
pub fn const_decl(self, name: impl Into<String>, value: Expr) -> Result<Self>
Add a const declaration.
Trait Implementations§
Source§impl Debug for JsModuleBuilder
impl Debug for JsModuleBuilder
Source§impl Default for JsModuleBuilder
impl Default for JsModuleBuilder
Source§fn default() -> JsModuleBuilder
fn default() -> JsModuleBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JsModuleBuilder
impl RefUnwindSafe for JsModuleBuilder
impl Send for JsModuleBuilder
impl Sync for JsModuleBuilder
impl Unpin for JsModuleBuilder
impl UnsafeUnpin for JsModuleBuilder
impl UnwindSafe for JsModuleBuilder
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