pub struct CaptureSite {
pub name: String,
pub field: Option<String>,
}Expand description
One capture bound in a query’s text, and the slot it is bound in.
Fields§
§name: StringThe capture’s name, without its @.
field: Option<String>The field label on the pattern this capture decorates — function for the @s in
(call_expression function: (identifier) @s) — or None when that pattern is an
unlabeled child or a top-level pattern.
Only the decorated pattern’s own slot: a capture nested inside a labeled child reports
the slot its pattern fills, not its ancestor’s, so the @x in (a b: (c (d) @x))
has no field.
Trait Implementations§
Source§impl Clone for CaptureSite
impl Clone for CaptureSite
Source§fn clone(&self) -> CaptureSite
fn clone(&self) -> CaptureSite
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CaptureSite
impl Debug for CaptureSite
impl Eq for CaptureSite
Source§impl PartialEq for CaptureSite
impl PartialEq for CaptureSite
impl StructuralPartialEq for CaptureSite
Auto Trait Implementations§
impl Freeze for CaptureSite
impl RefUnwindSafe for CaptureSite
impl Send for CaptureSite
impl Sync for CaptureSite
impl Unpin for CaptureSite
impl UnsafeUnpin for CaptureSite
impl UnwindSafe for CaptureSite
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