Struct ressa::node::VariableDecl
source · pub struct VariableDecl {
pub id: Pattern,
pub init: Option<Expression>,
}
Expand description
The identifier and optional value of a variable declaration
Fields
id: Pattern
init: Option<Expression>
Implementations
sourceimpl VariableDecl
impl VariableDecl
pub fn is_array(&self) -> bool
pub fn is_obj(&self) -> bool
pub fn uninitialized(name: &str) -> Self
pub fn with_value(name: &str, value: Expression) -> Self
pub fn destructed(names: &[&str], value: ObjectExpression) -> Self
pub fn destructed_with_rest(
names: &[&str],
rest: &str,
value: ObjectExpression
) -> Self
Trait Implementations
sourceimpl Clone for VariableDecl
impl Clone for VariableDecl
sourcefn clone(&self) -> VariableDecl
fn clone(&self) -> VariableDecl
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for VariableDecl
impl Debug for VariableDecl
sourceimpl PartialEq<VariableDecl> for VariableDecl
impl PartialEq<VariableDecl> for VariableDecl
sourcefn eq(&self, other: &VariableDecl) -> bool
fn eq(&self, other: &VariableDecl) -> bool
impl StructuralPartialEq for VariableDecl
Auto Trait Implementations
impl RefUnwindSafe for VariableDecl
impl Send for VariableDecl
impl Sync for VariableDecl
impl Unpin for VariableDecl
impl UnwindSafe for VariableDecl
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more