Struct VarDefInfo
pub struct VarDefInfo<'a> {
pub name: &'a str,
pub is_const: bool,
pub nesting_level: usize,
pub will_shadow: bool,
}
Expand description
Information on a variable declaration.
Fields§
§name: &'a str
VarDefInfo
fields will be private in the next major version. Use name()
instead.Name of the variable to be declared.
§Deprecated API
VarDefInfo
fields will be private in the next major version. Use name()
instead.
is_const: bool
VarDefInfo
fields will be private in the next major version. Use is_const()
instead.true
if the statement is const
, otherwise it is let
.
§Deprecated API
VarDefInfo
fields will be private in the next major version. Use is_const()
instead.
nesting_level: usize
VarDefInfo
fields will be private in the next major version. Use nesting_level()
instead.The current nesting level, with zero being the global level.
§Deprecated API
VarDefInfo
fields will be private in the next major version. Use nesting_level()
instead.
will_shadow: bool
VarDefInfo
fields will be private in the next major version. Use will_shadow_other_variables()
instead.Will the variable shadow an existing variable?
§Deprecated API
VarDefInfo
fields will be private in the next major version. Use will_shadow_other_variables()
instead.
Implementations§
§impl<'a> VarDefInfo<'a>
impl<'a> VarDefInfo<'a>
pub const fn nesting_level(&self) -> usize
pub const fn nesting_level(&self) -> usize
The current nesting level, with zero being the global level.
pub const fn is_global_level(&self) -> bool
pub const fn is_global_level(&self) -> bool
true
if the variable is declared at global level (i.e. nesting level zero).
pub const fn will_shadow_other_variables(&self) -> bool
pub const fn will_shadow_other_variables(&self) -> bool
Will the variable shadow an existing variable?
Trait Implementations§
§impl<'a> Clone for VarDefInfo<'a>
impl<'a> Clone for VarDefInfo<'a>
§fn clone(&self) -> VarDefInfo<'a>
fn clone(&self) -> VarDefInfo<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more