Enum rant::RantVar [−][src]
pub enum RantVar { ByVal(RantValue), ByValConst(RantValue), ByRef(Rc<RefCell<RantValue>>), ByRefConst(Rc<RantValue>), }
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)
By-value variable
ByValConst(RantValue)
By-value constant
By-ref variable
By-ref constant
Implementations
impl RantVar
[src]
impl RantVar
[src]pub fn is_const(&self) -> bool
[src]
Returns true
if the variable is a constant.
pub fn is_by_val(&self) -> bool
[src]
Returns true
if the variable is by-value.
pub fn is_by_ref(&self) -> bool
[src]
Returns true
if the variable is by-reference.
pub fn make_by_ref(&mut self)
[src]
Converts the variable to its by-reference counterpart.
pub fn write(&mut self, value: RantValue) -> bool
[src]
Attempts to write the specified value to the variable.
If the variable is a constant, returns false
; otherwise, returns true
.
pub fn value_ref(&self) -> impl Deref<Target = RantValue> + '_
[src]
Returns an immutable reference to the contained value.
pub fn value_cloned(&self) -> RantValue
[src]
Returns a copy of the variable value.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for RantVar
impl !RefUnwindSafe for RantVar
impl !UnwindSafe for RantVar
impl !UnwindSafe for RantVar