Struct lib_ruby_parser::nodes::Casgn
source · [−]#[repr(C)]pub struct Casgn {
pub scope: Option<Box<Node>>,
pub name: String,
pub value: Option<Box<Node>>,
pub double_colon_l: Option<Loc>,
pub name_l: Loc,
pub operator_l: Option<Loc>,
pub expression_l: Loc,
}Expand description
Represents a constant assignment (i.e. A = 1)
Fields
scope: Option<Box<Node>>Scope where the constant is defined:
Some(Const("A"))forA::B = 1Noneif it’s defined in the current scope (i.e.A = 1)Some(Cbase)if it’s defined in the global scope (i.e.::A = 1)
name: StringName of the constant, String("A") for A = 1
value: Option<Box<Node>>Value that is assigned to a constant, Int("1") for A = 1.
Note: None if constant assignment is a part of the multi-assignment.
In such case value belongs to Masgn node of the multi-assignment.
double_colon_l: Option<Loc>Location of the :: operator
A::B = 1
~~
::A = 1
~~None if the constant is defined in the current scope
name_l: LocLocation of the constant name
A::CONST = 1
~~~~~operator_l: Option<Loc>Location of the = operator
A = 1
~None if constant assignment is a part of the multi-assignment.
In such case = belongs to a Masgn node
expression_l: LocLocation of the full expression
A = 1
~~~~~Trait Implementations
impl StructuralPartialEq for Casgn
Auto Trait Implementations
impl RefUnwindSafe for Casgn
impl Send for Casgn
impl Sync for Casgn
impl Unpin for Casgn
impl UnwindSafe for Casgn
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more