pub struct WithStmt<'a> {
pub object: Expr<'a>,
pub body: Box<Stmt<'a>>,
}Expand description
A with statement, this puts one object at the top of the identifier search tree.
note: this cannot be used in a strict context
function random() {
return 0;
}
let rand;
with (Math) {
rand = floor(random() * 100) + 1;
}
//rand !== 0Fields§
§object: Expr<'a>§body: Box<Stmt<'a>>Trait Implementations§
impl<'a> StructuralPartialEq for WithStmt<'a>
Auto Trait Implementations§
impl<'a> Freeze for WithStmt<'a>
impl<'a> RefUnwindSafe for WithStmt<'a>
impl<'a> Send for WithStmt<'a>
impl<'a> Sync for WithStmt<'a>
impl<'a> Unpin for WithStmt<'a>
impl<'a> UnwindSafe for WithStmt<'a>
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