Enum apollo_compiler::database::hir::Value
source · pub enum Value {
Variable(Variable),
Int {
value: Float,
loc: HirNodeLocation,
},
Float {
value: Float,
loc: HirNodeLocation,
},
String {
value: String,
loc: HirNodeLocation,
},
Boolean {
value: bool,
loc: HirNodeLocation,
},
Null {
loc: HirNodeLocation,
},
Enum {
value: Name,
loc: HirNodeLocation,
},
List {
value: Vec<Value>,
loc: HirNodeLocation,
},
Object {
value: Vec<(Name, Value)>,
loc: HirNodeLocation,
},
}Variants§
Implementations§
source§impl Value
impl Value
sourcepub fn is_same_value(&self, other: &Value) -> bool
pub fn is_same_value(&self, other: &Value) -> bool
Returns true if other represents the same value as self. This is different from the
Eq implementation as it ignores location information.
sourcepub fn loc(&self) -> HirNodeLocation
pub fn loc(&self) -> HirNodeLocation
Get current value’s location.
pub fn variables(&self) -> Vec<Variable>
pub fn kind(&self) -> &str
sourcepub fn is_variable(&self) -> bool
pub fn is_variable(&self) -> bool
Returns true if the value is Variable.
Trait Implementations§
source§impl PartialEq<Value> for Value
impl PartialEq<Value> for Value
impl Eq for Value
impl StructuralEq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.