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
sourceimpl 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>
Use the pattern graph[value.into_syntax_node_ref(graph)] instead
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
sourceimpl From<GraphNodeRef> for Value
impl From<GraphNodeRef> for Value
sourcefn from(value: GraphNodeRef) -> Value
fn from(value: GraphNodeRef) -> Value
Converts to this type from the input type.
sourceimpl From<SyntaxNodeRef> for Value
impl From<SyntaxNodeRef> for Value
sourcefn from(value: SyntaxNodeRef) -> Value
fn from(value: SyntaxNodeRef) -> Value
Converts to this type from the input type.
sourceimpl Ord for Value
impl Ord for Value
sourceimpl PartialOrd<Value> for Value
impl PartialOrd<Value> for Value
sourcefn partial_cmp(&self, other: &Value) -> Option<Ordering>
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more