[][src]Struct endbasic_core::ast::VarRef

pub struct VarRef { /* fields omitted */ }

Represents a reference to a variable (which doesn't have to exist).

Implementations

impl VarRef[src]

pub fn new<T: Into<String>>(name: T, ref_type: VarType) -> Self[src]

Creates a new reference to the variable with name and the optional vtype type.

pub fn into_unannotated_string(self) -> Result<String, Error>[src]

Transforms this reference into an unannotated name.

This is only valid for references that have no annotations in them.

pub fn name(&self) -> &str[src]

Returns the name of this reference, without any type annotations.

pub fn ref_type(&self) -> VarType[src]

Returns the type of this reference.

pub fn accepts(&self, value: &Value) -> bool[src]

Returns true if this reference is compatible with the given value's type.

Trait Implementations

impl Clone for VarRef[src]

impl Debug for VarRef[src]

impl Display for VarRef[src]

impl Eq for VarRef[src]

impl PartialEq<VarRef> for VarRef[src]

impl StructuralEq for VarRef[src]

impl StructuralPartialEq for VarRef[src]

Auto Trait Implementations

impl RefUnwindSafe for VarRef

impl Send for VarRef

impl Sync for VarRef

impl Unpin for VarRef

impl UnwindSafe for VarRef

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> ToString for T where
    T: Display + ?Sized
[src]

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.