[][src]Struct lib_ruby_parser::nodes::Casgn

pub struct Casgn {
    pub scope: Option<Box<Node>>,
    pub name: String,
    pub value: Option<Box<Node>>,
    pub double_colon_l: Option<Range>,
    pub name_l: Range,
    pub operator_l: Option<Range>,
    pub expression_l: Range,
}

Represents a constant assignment (i.e. A = 1)

Fields

scope: Option<Box<Node>>

Scope where the constant is defined: 1. Some(Const("A")) for A::B = 1 2. None if it's defined in the current scope (i.e. A = 1) 3. Some(Cbase) if it's defined in the global scope (i.e. ::A = 1)

name: String

Name 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<Range>

Location of the :: operator

A::B = 1
 ~~

::A = 1
~~

None if the constant is defined in the current scope

name_l: Range

Location of the constant name

A::CONST = 1
   ~~~~~
operator_l: Option<Range>

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: Range

Location of the full expression

A = 1
~~~~~

Trait Implementations

impl Clone for Casgn[src]

impl Debug for Casgn[src]

impl PartialEq<Casgn> for Casgn[src]

impl StructuralPartialEq for Casgn[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.