Struct Error

Source
pub struct Error<'tree>(/* private fields */);
Expand description

A stub node that indicates a localized parse error.

Trait Implementations§

Source§

impl<'tree> Clone for Error<'tree>

Source§

fn clone(&self) -> Error<'tree>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'tree> Debug for Error<'tree>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'tree> Hash for Error<'tree>

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'tree> Node<'tree> for Error<'tree>

Source§

const KIND: &'static str = "{error}"

Kind of nodes this wraps. Read more
Source§

type WithLifetime<'a> = Error<'a>

The same type, but with a different lifetime.
Source§

fn try_from_raw(node: Node<'tree>) -> Result<Error<'tree>, IncorrectKind<'tree>>

Check that the tree-sitter node is the correct kind, and if it is, wrap. Read more
Source§

unsafe fn from_raw_unchecked(node: Node<'tree>) -> Error<'tree>

Assume that tree-sitter node is the correct kind and wrap. Read more
Source§

fn raw(&self) -> &Node<'tree>

The wrapped tree-sitter node. Read more
Source§

fn raw_mut(&mut self) -> &mut Node<'tree>

The wrapped tree-sitter node (mutable reference, rarely needed). Read more
Source§

fn into_raw(self) -> Node<'tree>

Destruct into the wrapped tree-sitter node. Read more
Source§

fn upcast(self) -> UntypedNode<'tree>

Upcast into an untyped node. Read more
Source§

fn utf8_text<'a>(&self, source: &'a [u8]) -> Result<&'a str, Utf8Error>

Source§

fn utf16_text<'a>(&self, source: &'a [u16]) -> &'a [u16]

Source§

fn prefixes(&self) -> impl Iterator<Item = UntypedNode<'tree>>

Returns any extra nodes before this one, e.g., comments. Read more
Source§

fn suffixes(&self) -> impl Iterator<Item = UntypedNode<'tree>>

Returns any extra nodes after this one, e.g., comments. Read more
Source§

fn walk(&self) -> TreeCursor<'tree>

Get a cursor for this node
Source§

fn parent(&self) -> Option<UntypedNode<'tree>>

Get the node’s immediate parent
Source§

fn next_named_sibling(&self) -> Option<UntypedNode<'tree>>

Get the node’s immediate named next sibling
Source§

fn prev_named_sibling(&self) -> Option<UntypedNode<'tree>>

Get the node’s immediate named previous sibling
Source§

fn named_child_count(&self) -> usize

Get the number of named children
Source§

fn to_sexp(&self) -> String

Print the node as an s-expression
Source§

fn kind(&self) -> &'static str

Get this node’s tree-sitter name. See tree-sitter’s Node::kind
Source§

fn is_named(&self) -> bool

Check if this node is named. See tree-sitter’s Node::is_named
Source§

fn has_changes(&self) -> bool

Check if this node has been edited
Source§

fn has_error(&self) -> bool

Check if this node represents a syntax error or contains any syntax errors anywhere within it
Source§

fn start_byte(&self) -> usize

Get the byte offset where this node starts
Source§

fn end_byte(&self) -> usize

Get the byte offset where this node ends
Source§

fn start_position(&self) -> Point

Get the row and column where this node starts
Source§

fn end_position(&self) -> Point

Get the row and column where this node ends
Source§

fn range(&self) -> Range

Get the byte range and row and column range where this node is located
Source§

fn byte_range(&self) -> Range<usize>

Get the byte range where this node is located
Source§

fn edit(&mut self, edit: &InputEdit)

Edit this node to keep it in-sync with source code that has been edited. See tree-sitter’s Node::edit
Source§

impl<'tree> PartialEq for Error<'tree>

Source§

fn eq(&self, other: &Error<'tree>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'tree> Copy for Error<'tree>

Source§

impl<'tree> Eq for Error<'tree>

Source§

impl<'tree> StructuralPartialEq for Error<'tree>

Auto Trait Implementations§

§

impl<'tree> Freeze for Error<'tree>

§

impl<'tree> RefUnwindSafe for Error<'tree>

§

impl<'tree> Send for Error<'tree>

§

impl<'tree> Sync for Error<'tree>

§

impl<'tree> Unpin for Error<'tree>

§

impl<'tree> UnwindSafe for Error<'tree>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.