tree_sitter_facade

Struct Parser

Source
pub struct Parser { /* private fields */ }

Implementations§

Source§

impl Parser

Source

pub fn new() -> Result<Self, ParserError>

Source

pub unsafe fn cancellation_flag(&self) -> Option<&AtomicUsize>

Source

pub fn language(&self) -> Option<Language>

Source

pub fn logger(&self) -> Option<LoggerReturn<'_, '_>>

Source

pub fn parse( &mut self, text: impl AsRef<[u8]>, old_tree: Option<&Tree>, ) -> Result<Option<Tree>, ParserError>

Source

pub fn parse_utf16( &mut self, text: impl AsRef<[u16]>, old_tree: Option<&Tree>, ) -> Result<Option<Tree>, ParserError>

Source

pub fn parse_utf16_with<T>( &mut self, callback: impl FnMut(u32, Point) -> T, old_tree: Option<&Tree>, ) -> Result<Option<Tree>, ParserError>
where T: AsRef<[u16]>,

Source

pub fn parse_with<T>( &mut self, callback: impl FnMut(u32, Point) -> T + 'static, old_tree: Option<&Tree>, ) -> Result<Option<Tree>, ParserError>
where T: AsRef<[u8]>,

Source

pub fn print_dot_graphs(&mut self, file: &impl AsRawFd)

Source

pub fn reset(&mut self)

Source

pub unsafe fn set_cancellation_flag(&mut self, flag: Option<&AtomicUsize>)

Source

pub fn set_included_ranges( &mut self, ranges: &[Range], ) -> Result<(), IncludedRangesError>

Source

pub fn set_language(&mut self, language: &Language) -> Result<(), LanguageError>

Source

pub fn set_logger(&mut self, logger: Option<Logger<'static>>)

Source

pub fn set_timeout_micros(&mut self, timeout_micros: f64)

Source

pub fn stop_printing_dot_graphs(&mut self)

Source

pub fn timeout_micros(&self) -> f64

Trait Implementations§

Source§

impl From<Parser> for Parser

Source§

fn from(inner: Parser) -> Self

Converts to this type from the input type.
Source§

impl RefUnwindSafe for Parser

Source§

impl Send for Parser

Source§

impl Unpin for Parser

Source§

impl UnwindSafe for Parser

Auto Trait Implementations§

§

impl Freeze for Parser

§

impl Sync for Parser

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> 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, 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.