[−][src]Struct endbasic_core::ast::VarRef
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[src]
impl Send for VarRef[src]
impl Sync for VarRef[src]
impl Unpin for VarRef[src]
impl UnwindSafe for VarRef[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,