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

#[repr(C)]
pub struct Casgn { pub scope: MaybePtr<Node>, pub name: StringPtr, pub value: MaybePtr<Node>, pub double_colon_l: MaybeLoc, pub name_l: Loc, pub operator_l: MaybeLoc, pub expression_l: Loc, }

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

Fields

scope: MaybePtr<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: StringPtr

Name of the constant, String("A") for A = 1

value: MaybePtr<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: MaybeLoc

Location of the :: operator

A::B = 1
 ~~

::A = 1
~~

None if the constant is defined in the current scope

name_l: Loc

Location of the constant name

A::CONST = 1
   ~~~~~
operator_l: MaybeLoc

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

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.