pub struct Input<'tree, Ctx> {
pub node: Node<'tree>,
pub ctx: Ctx,
pub trigger_char: Option<char>,
}Expand description
A snapshot of the current tree-sitter node together with caller-supplied context.
Input is designed to be passed by value; it is Copy whenever Ctx
is Copy.
§Example
// Input<()> uses the unit type as a zero-sized context.
// In real usage Ctx is typically a shared reference to your extractor.
use tree_sitter_utils::Input;
fn accepts_input(_: Input<()>) {}Fields§
§node: Node<'tree>The current syntax-tree node being examined.
ctx: CtxCaller-supplied context (e.g. a reference to an extractor struct).
trigger_char: Option<char>An optional trigger character hint (e.g. . or (), if the call
site has one.
Implementations§
Trait Implementations§
impl<'tree, Ctx: Copy> Copy for Input<'tree, Ctx>
Auto Trait Implementations§
impl<'tree, Ctx> Freeze for Input<'tree, Ctx>where
Ctx: Freeze,
impl<'tree, Ctx> RefUnwindSafe for Input<'tree, Ctx>where
Ctx: RefUnwindSafe,
impl<'tree, Ctx> Send for Input<'tree, Ctx>where
Ctx: Send,
impl<'tree, Ctx> Sync for Input<'tree, Ctx>where
Ctx: Sync,
impl<'tree, Ctx> Unpin for Input<'tree, Ctx>where
Ctx: Unpin,
impl<'tree, Ctx> UnsafeUnpin for Input<'tree, Ctx>where
Ctx: UnsafeUnpin,
impl<'tree, Ctx> UnwindSafe for Input<'tree, Ctx>where
Ctx: UnwindSafe,
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