Skip to main content

TypedNodeList

Struct TypedNodeList 

Source
pub struct TypedNodeList<'a, G: TypedGrammar, T> { /* private fields */ }
Expand description

Typed read-only view over a list node in the arena.

Used throughout generated AST APIs for child collections.

Implementations§

Source§

impl<G: TypedGrammar, T> TypedNodeList<'_, G, T>

Source

pub fn node_id(&self) -> G::NodeId

The arena node ID of this list, as the grammar’s typed node ID.

Source

pub fn len(&self) -> usize

Number of children.

Source

pub fn is_empty(&self) -> bool

Whether this list has no children.

Source§

impl<'a, G: TypedGrammar, T: GrammarNodeType<'a>> TypedNodeList<'a, G, T>

Source

pub fn get(&self, index: usize) -> Option<T>

Get a child by index, or None if out of bounds or unresolvable.

Source

pub fn iter(&self) -> impl Iterator<Item = T> + 'a

Iterate over children. Unresolvable IDs are silently skipped.

Trait Implementations§

Source§

impl<'a, G: Clone + TypedGrammar, T: Clone> Clone for TypedNodeList<'a, G, T>

Source§

fn clone(&self) -> TypedNodeList<'a, G, T>

Returns a duplicate 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<G: TypedGrammar, T> Debug for TypedNodeList<'_, G, T>

Source§

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

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

impl<'a> From<TypedNodeList<'a, Grammar, CaseWhen<'a>>> for CaseWhenListId

Source§

fn from(n: CaseWhenList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, ColumnConstraint<'a>>> for ColumnConstraintListId

Source§

fn from(n: ColumnConstraintList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, ColumnDef<'a>>> for ColumnDefListId

Source§

fn from(n: ColumnDefList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, CteDefinition<'a>>> for CteListId

Source§

fn from(n: CteList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, Expr<'a>>> for ExprListId

Source§

fn from(n: ExprList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, NamedWindowDef<'a>>> for NamedWindowDefListId

Source§

fn from(n: NamedWindowDefList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, OrderingTerm<'a>>> for OrderByListId

Source§

fn from(n: OrderByList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, ResultColumn<'a>>> for ResultColumnListId

Source§

fn from(n: ResultColumnList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, SetClause<'a>>> for SetClauseListId

Source§

fn from(n: SetClauseList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, Stmt<'a>>> for TriggerCmdListId

Source§

fn from(n: TriggerCmdList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, TableConstraint<'a>>> for TableConstraintListId

Source§

fn from(n: TableConstraintList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, TypedNodeList<'a, Grammar, Expr<'a>>>> for ValuesRowListId

Source§

fn from(n: ValuesRowList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, UpsertClause<'a>>> for UpsertClauseListId

Source§

fn from(n: UpsertClauseList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<TypedNodeList<'a, Grammar, WindowDef<'a>>> for WindowDefListId

Source§

fn from(n: WindowDefList<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a, G: TypedGrammar, T> GrammarNodeType<'a> for TypedNodeList<'a, G, T>

Blanket GrammarNodeType impl for TypedNodeList — resolves the ID as a list node.

Source§

fn from_result( stmt_result: &'a AnyParsedStatement<'a>, id: AnyNodeId, ) -> Option<Self>

Resolve id to Self, or None if null, invalid, or tag mismatch.
Source§

impl<G: TypedGrammar, T: Clone> Copy for TypedNodeList<'_, G, T>

Auto Trait Implementations§

§

impl<'a, G, T> Freeze for TypedNodeList<'a, G, T>

§

impl<'a, G, T> !RefUnwindSafe for TypedNodeList<'a, G, T>

§

impl<'a, G, T> !Send for TypedNodeList<'a, G, T>

§

impl<'a, G, T> !Sync for TypedNodeList<'a, G, T>

§

impl<'a, G, T> Unpin for TypedNodeList<'a, G, T>

§

impl<'a, G, T> UnsafeUnpin for TypedNodeList<'a, G, T>

§

impl<'a, G, T> !UnwindSafe for TypedNodeList<'a, G, 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 = 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.