pub struct AnnotationArg { /* private fields */ }Implementations§
Source§impl AnnotationArg
impl AnnotationArg
pub fn name_token(&self) -> Option<SyntaxToken>
Sourcepub fn nested_args(&self) -> Option<AnnotationArgs>
pub fn nested_args(&self) -> Option<AnnotationArgs>
The nested paren-clause (reads(gold, hp) inside effects(…)), if
this argument has one.
Sourcepub fn path(&self) -> Option<Path>
pub fn path(&self) -> Option<Path>
The unquoted ::-separated module PATH (story::old::path), if
this argument is one (issue #1349, @[was(story::old::path)]’s
arg form). name_token is None for this shape — the arg’s direct
child is a PATH node, not a bare IDENT token.
Sourcepub fn eq_value(&self) -> Option<StringLit>
pub fn eq_value(&self) -> Option<StringLit>
The = "value" clause’s string-literal value (issue #1719,
@[element(args = "…")] / @[style(chan = "…")]), if this argument
has one. None for the bare-IDENT, nested-clause, path, and
numeric-literal shapes — only the key/value form parses a
STRING_LIT as a sibling of the key IDENT rather than the
arg’s sole child.
Sourcepub fn eq_int_value(&self) -> Option<IntegerLit>
pub fn eq_int_value(&self) -> Option<IntegerLit>
The = <integer> clause’s integer-literal value (issue #2164,
@[convention(…, order = 30)] — the ordering key is a bare integer,
RULED). None for every other clause shape, including the string
key/value form Self::eq_value reads — a clause carries at most
one of the two, never both.
Sourcepub fn eq_ident_value(&self) -> Option<SyntaxToken>
pub fn eq_ident_value(&self) -> Option<SyntaxToken>
The = <ident> clause’s bare-identifier value (issue #2178,
@[convention(…, attach = Cue)] — the attached schema names a
declared struct, so this clause is a bare identifier, not a
quoted string or integer literal). None for every other clause
shape.
Unlike Self::eq_value/Self::eq_int_value, this is not a
distinct child node kind — the value is bumped as a second bare
IDENT token, a sibling of the key’s own IDENT token (see
parser::annotation::annotation_arg’s IDENT arm). So this reads
the second direct-child IDENT token, not the first (which
Self::name_token already owns).
Trait Implementations§
Source§impl AstNode for AnnotationArg
impl AstNode for AnnotationArg
Source§fn can_cast(kind: SyntaxKind) -> bool
fn can_cast(kind: SyntaxKind) -> bool
true for a node with a SyntaxKind this type can wrap.Source§fn cast(node: SyntaxNode) -> Option<Self>
fn cast(node: SyntaxNode) -> Option<Self>
SyntaxNode into this typed wrapper.Source§fn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
SyntaxNode.Source§impl Clone for AnnotationArg
impl Clone for AnnotationArg
Source§fn clone(&self) -> AnnotationArg
fn clone(&self) -> AnnotationArg
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more