pub enum RantVar {
    ByVal(RantValue),
    ByValConst(RantValue),
    ByRef(Rc<RefCell<RantValue>>),
    ByRefConst(Rc<RantValue>),
}
Expand description

Represents a Rant variable of one of two flavors: by-value or by-reference.

Cloning

The Clone implementation for this type does not copy any data in ByRef* variants; it only copies the reference.

Variants

ByVal(RantValue)

Tuple Fields

By-value variable

ByValConst(RantValue)

Tuple Fields

By-value constant

ByRef(Rc<RefCell<RantValue>>)

Tuple Fields

By-ref variable

ByRefConst(Rc<RantValue>)

Tuple Fields

By-ref constant

Implementations

Returns true if the variable is a constant.

Returns true if the variable is by-value.

Returns true if the variable is by-reference.

Converts the variable to its by-reference counterpart.

Attempts to write the specified value to the variable. If the variable is a constant, returns false; otherwise, returns true.

Returns an immutable reference to the contained value.

Returns a copy of the variable value.

Trait Implementations

Creates a copy of the variable, preserving references.

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.