Skip to main content

VoidSyntax

Struct VoidSyntax 

Source
pub struct VoidSyntax<T: Token> { /* private fields */ }
Expand description

A Node without a syntax parser.

You are encouraged to use this object with the Document or the MutableUnit when you need an incremental lexical parser, but you don’t need a syntax parser: Document::<VoidSyntax<MyToken>>::new_mutable("foo bar baz").

This object makes the syntax parsing stage of the incremental reprarser a noop.

Trait Implementations§

Source§

impl<T: Token> AbstractNode for VoidSyntax<T>

Source§

fn rule(&self) -> NodeRule

A syntax parse rule that parses this kind of node. Read more
Source§

fn name(&self) -> Option<&'static str>

A debug name of this node. Read more
Source§

fn describe(&self, _verbose: bool) -> Option<&'static str>

An end-user display description of this node. Read more
Source§

fn node_ref(&self) -> NodeRef

Returns a NodeRef reference of this node. Read more
Source§

fn parent_ref(&self) -> NodeRef

Returns a NodeRef reference of the parent node of this node. Read more
Source§

fn set_parent_ref(&mut self, _parent_ref: NodeRef)

Updates the parent node reference of this node. Read more
Source§

fn capture(&self, _key: Key<'_>) -> Option<Capture<'_>>

Returns a set of children of this node associated with the specified key. Read more
Source§

fn capture_keys(&self) -> &'static [Key<'static>]

Returns all valid capture keys. Read more
Source§

fn rule_name(_rule: NodeRule) -> Option<&'static str>
where Self: Sized,

A debug name of the parse rule. Read more
Source§

fn rule_description(_rule: NodeRule, _verbose: bool) -> Option<&'static str>
where Self: Sized,

An end-user display description of the parse rule. Read more
Source§

fn first_capture(&self) -> Option<Capture<'_>>

Returns the first set of children of this node. Read more
Source§

fn last_capture(&self) -> Option<Capture<'_>>

Returns the last set of children of this node. Read more
Source§

fn captures_len(&self) -> usize

Returns a total number of captures of this node instance.
Source§

fn captures_iter(&self) -> CapturesIter<'_, Self>
where Self: Sized,

Returns an iterator over all capture values.
Source§

fn children_iter(&self) -> ChildrenIter<'_, Self>
where Self: Sized,

Returns an iterator over all children of this node. Read more
Source§

fn prev_child_node(&self, current: &NodeRef) -> Option<&NodeRef>
where Self: Sized,

Returns a NodeRef reference of a child node that precedes the current child node. Read more
Source§

fn next_child_node(&self, current: &NodeRef) -> Option<&NodeRef>
where Self: Sized,

Returns a NodeRef reference of a child node that follows after the current child node. Read more
Source§

fn span(&self, unit: &impl CompilationUnit) -> Option<SiteSpan>
where Self: Sized,

Infers the site span of this node. Read more
Source§

fn start(&self, unit: &impl CompilationUnit) -> Option<Site>
where Self: Sized,

Infers the start site of this node. Read more
Source§

fn end(&self, unit: &impl CompilationUnit) -> Option<Site>
where Self: Sized,

Infers the end site of this node. Read more
Source§

impl<T: Clone + Token> Clone for VoidSyntax<T>

Source§

fn clone(&self) -> VoidSyntax<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Token> Debug for VoidSyntax<T>

Source§

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

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

impl<T: Token> Default for VoidSyntax<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: Eq + Token> Eq for VoidSyntax<T>

Source§

impl<T: Token> Node for VoidSyntax<T>

Source§

type Token = T

Specifies the lexical structure of the language. Read more
Source§

fn parse<'code>( _session: &mut impl SyntaxSession<'code, Node = Self>, _rule: NodeRule, ) -> Self

Parses the programming language syntax tree node. Read more
Source§

fn debug(text: impl AsRef<str>)

Debugs the syntax parsing algorithm for this node type. Read more
Source§

impl<T: PartialEq + Token> PartialEq for VoidSyntax<T>

Source§

fn eq(&self, other: &VoidSyntax<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<T: PartialEq + Token> StructuralPartialEq for VoidSyntax<T>

Auto Trait Implementations§

§

impl<T> Freeze for VoidSyntax<T>
where PhantomData<T>: Freeze,

§

impl<T> RefUnwindSafe for VoidSyntax<T>

§

impl<T> Send for VoidSyntax<T>
where PhantomData<T>: Send,

§

impl<T> Sync for VoidSyntax<T>
where PhantomData<T>: Sync,

§

impl<T> Unpin for VoidSyntax<T>
where PhantomData<T>: Unpin,

§

impl<T> UnsafeUnpin for VoidSyntax<T>

§

impl<T> UnwindSafe for VoidSyntax<T>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.