Enum tree_sitter_graph::graph::Value
source · pub enum Value {
Null,
Boolean(bool),
Integer(u32),
String(String),
List(Vec<Value>),
Set(BTreeSet<Value>),
SyntaxNode(SyntaxNodeRef),
GraphNode(GraphNodeRef),
}Expand description
The value of an attribute
Variants§
Null
Boolean(bool)
Integer(u32)
String(String)
List(Vec<Value>)
Set(BTreeSet<Value>)
SyntaxNode(SyntaxNodeRef)
GraphNode(GraphNodeRef)
Implementations§
source§impl Value
impl Value
sourcepub fn into_boolean(self) -> Result<bool, ExecutionError>
pub fn into_boolean(self) -> Result<bool, ExecutionError>
Coerces this value into a boolean, returning an error if it’s some other type of value.
pub fn as_boolean(&self) -> Result<bool, ExecutionError>
sourcepub fn into_integer(self) -> Result<u32, ExecutionError>
pub fn into_integer(self) -> Result<u32, ExecutionError>
Coerces this value into an integer, returning an error if it’s some other type of value.
pub fn as_integer(&self) -> Result<u32, ExecutionError>
sourcepub fn into_string(self) -> Result<String, ExecutionError>
pub fn into_string(self) -> Result<String, ExecutionError>
Coerces this value into a string, returning an error if it’s some other type of value.
pub fn as_str(&self) -> Result<&str, ExecutionError>
sourcepub fn into_list(self) -> Result<Vec<Value>, ExecutionError>
pub fn into_list(self) -> Result<Vec<Value>, ExecutionError>
Coerces this value into a list, returning an error if it’s some other type of value.
pub fn as_list(&self) -> Result<&Vec<Value>, ExecutionError>
sourcepub fn into_graph_node_ref<'a, 'tree>(
self
) -> Result<GraphNodeRef, ExecutionError>
pub fn into_graph_node_ref<'a, 'tree>( self ) -> Result<GraphNodeRef, ExecutionError>
Coerces this value into a graph node reference, returning an error if it’s some other type of value.
pub fn as_graph_node_ref<'a, 'tree>( &self ) -> Result<GraphNodeRef, ExecutionError>
sourcepub fn into_syntax_node_ref<'a, 'tree>(
self
) -> Result<SyntaxNodeRef, ExecutionError>
pub fn into_syntax_node_ref<'a, 'tree>( self ) -> Result<SyntaxNodeRef, ExecutionError>
Coerces this value into a syntax node reference, returning an error if it’s some other type of value.
sourcepub fn into_syntax_node<'a, 'tree>(
self,
graph: &'a Graph<'tree>
) -> Result<&'a Node<'tree>, ExecutionError>
👎Deprecated: Use the pattern graph[value.into_syntax_node_ref(graph)] instead
pub fn into_syntax_node<'a, 'tree>( self, graph: &'a Graph<'tree> ) -> Result<&'a Node<'tree>, ExecutionError>
Coerces this value into a syntax node, returning an error if it’s some other type of value.
pub fn as_syntax_node_ref<'a, 'tree>( &self ) -> Result<SyntaxNodeRef, ExecutionError>
Trait Implementations§
source§impl From<GraphNodeRef> for Value
impl From<GraphNodeRef> for Value
source§fn from(value: GraphNodeRef) -> Value
fn from(value: GraphNodeRef) -> Value
Converts to this type from the input type.
source§impl From<SyntaxNodeRef> for Value
impl From<SyntaxNodeRef> for Value
source§fn from(value: SyntaxNodeRef) -> Value
fn from(value: SyntaxNodeRef) -> Value
Converts to this type from the input type.
source§impl Ord for Value
impl Ord for Value
source§impl PartialEq<Value> for Value
impl PartialEq<Value> for Value
source§impl PartialOrd<Value> for Value
impl PartialOrd<Value> for Value
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more