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
pub fn from_nodes<'tree, NI: IntoIterator<Item = Node<'tree>>>( graph: &mut Graph<'tree>, nodes: NI, quantifier: CaptureQuantifier ) -> Value
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 for Value
impl PartialEq for Value
source§impl PartialOrd for Value
impl PartialOrd 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 moreimpl Eq 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