pub struct CppInitDeclarator { /* private fields */ }Expand description
An init-declarator: a declarator plus an optional initializer.
Implementations§
Source§impl CppInitDeclarator
impl CppInitDeclarator
pub fn get_declarator(&self) -> Option<CppDeclarator>
pub fn get_name(&self) -> Option<CppNameToken>
Sourcepub fn get_requires_clause(&self) -> Option<CppRequiresClause>
pub fn get_requires_clause(&self) -> Option<CppRequiresClause>
The requires-clause written after the declarator, when the declaration has one.
void constrained(int x) const requires (x > 0) {} is an InitDeclarator holding the declarator (with its
const) and a RequiresClause after it, so the clause is this node’s sibling rather than part of the declarator.
pub fn get_initializer(&self) -> Option<CppInitializer>
Sourcepub fn get_structured_binding(&self) -> Option<CppStructuredBinding>
pub fn get_structured_binding(&self) -> Option<CppStructuredBinding>
The structured binding this init-declarator introduces, in either spelling.
auto [a, b] = pair; puts the pattern directly under the init-declarator, while
auto& [k, v] = map; puts it inside the declarator, after the &. This is the one place that
knows both, so a caller asking “is this a binding?” gets one answer.
pub fn is_structured_binding(&self) -> bool
Trait Implementations§
Source§impl Clone for CppInitDeclarator
impl Clone for CppInitDeclarator
Source§impl CppAstNode for CppInitDeclarator
impl CppAstNode for CppInitDeclarator
fn syntax(&self) -> &CppSyntaxNode
Source§fn can_cast(kind: CppSyntaxKind) -> bool
fn can_cast(kind: CppSyntaxKind) -> bool
Is a node of this kind a node of type
Self? Read morefn cast(syntax: CppSyntaxNode) -> Option<Self>
Source§fn child<N: CppAstNode>(&self) -> Option<N>
fn child<N: CppAstNode>(&self) -> Option<N>
The first child node of type
N.Source§fn token<N: CppAstToken>(&self) -> Option<N>
fn token<N: CppAstToken>(&self) -> Option<N>
The first child token of type
N.Source§fn token_by_kind(&self, kind: CppTokenKind) -> Option<CppGeneralToken>
fn token_by_kind(&self, kind: CppTokenKind) -> Option<CppGeneralToken>
The first child token with the given kind, as a generic token.
Source§fn children<N: CppAstNode>(&self) -> CppAstChildren<N> ⓘ
fn children<N: CppAstNode>(&self) -> CppAstChildren<N> ⓘ
All child nodes of type
N.Source§fn tokens<N: CppAstToken>(&self) -> CppAstTokenChildren<N> ⓘ
fn tokens<N: CppAstToken>(&self) -> CppAstTokenChildren<N> ⓘ
All child tokens of type
N.Source§fn descendants<N: CppAstNode>(&self) -> impl Iterator<Item = N>
fn descendants<N: CppAstNode>(&self) -> impl Iterator<Item = N>
All descendant nodes of type
N.Source§fn walk_descendants<N: CppAstNode>(&self) -> impl Iterator<Item = WalkEvent<N>>
fn walk_descendants<N: CppAstNode>(&self) -> impl Iterator<Item = WalkEvent<N>>
All descendants of type
N, with enter/leave events.Source§fn ancestors<N: CppAstNode>(&self) -> impl Iterator<Item = N>
fn ancestors<N: CppAstNode>(&self) -> impl Iterator<Item = N>
All ancestor nodes of type
N, innermost first.Source§fn get_root(&self) -> CppSyntaxNode
fn get_root(&self) -> CppSyntaxNode
The root of the tree this node belongs to.
Source§fn previous_sibling<N: CppAstNode>(&self) -> Option<N>
fn previous_sibling<N: CppAstNode>(&self) -> Option<N>
The sibling node immediately before this one, when it is of type
N. Read moreSource§fn next_sibling<N: CppAstNode>(&self) -> Option<N>
fn next_sibling<N: CppAstNode>(&self) -> Option<N>
The sibling node immediately after this one, when it is of type
N.Source§fn get_parent<N: CppAstNode>(&self) -> Option<N>
fn get_parent<N: CppAstNode>(&self) -> Option<N>
The parent node, if it is of type
N.fn get_position(&self) -> TextSize
fn get_range(&self) -> TextRange
Source§fn get_self_or_ancestor<N: CppAstNode>(&self) -> Option<N>
fn get_self_or_ancestor<N: CppAstNode>(&self) -> Option<N>
The containing node of type
N, starting from this node itself.Source§fn get_syntax_id(&self) -> CppSyntaxId
fn get_syntax_id(&self) -> CppSyntaxId
A storable, comparable handle to this node. See
CppSyntaxId.Source§impl Debug for CppInitDeclarator
impl Debug for CppInitDeclarator
impl Eq for CppInitDeclarator
Source§impl Hash for CppInitDeclarator
impl Hash for CppInitDeclarator
Source§impl PartialEq for CppInitDeclarator
impl PartialEq for CppInitDeclarator
impl StructuralPartialEq for CppInitDeclarator
Auto Trait Implementations§
impl !RefUnwindSafe for CppInitDeclarator
impl !Send for CppInitDeclarator
impl !Sync for CppInitDeclarator
impl !UnwindSafe for CppInitDeclarator
impl Forget for CppInitDeclarator
impl Freeze for CppInitDeclarator
impl Move for CppInitDeclarator
impl Unpin for CppInitDeclarator
impl UnsafeUnpin for CppInitDeclarator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more