Enum apollo_compiler::ast::Value
source · pub enum Value {
Null,
Enum(Name),
Variable(Name),
String(NodeStr),
Float(FloatValue),
Int(IntValue),
Boolean(bool),
List(Vec<Node<Value>>),
Object(Vec<(Name, Node<Value>)>),
}
Variants§
Null
Enum(Name)
Variable(Name)
String(NodeStr)
Float(FloatValue)
Int(IntValue)
Boolean(bool)
List(Vec<Node<Value>>)
Object(Vec<(Name, Node<Value>)>)
Implementations§
source§impl Value
impl Value
pub fn is_null(&self) -> bool
pub fn as_enum(&self) -> Option<&Name>
pub fn as_variable(&self) -> Option<&Name>
pub fn as_str(&self) -> Option<&str>
pub fn as_node_str(&self) -> Option<&NodeStr>
pub fn to_f64(&self) -> Option<f64>
pub fn to_i32(&self) -> Option<i32>
pub fn to_bool(&self) -> Option<bool>
pub fn as_list(&self) -> Option<&[Node<Value>]>
pub fn as_object(&self) -> Option<&[(Name, Node<Value>)]>
pub fn kind(&self) -> &'static str
Trait Implementations§
source§impl PartialEq for Value
impl PartialEq 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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.