pub struct Attribute { /* private fields */ }Expand description
A Attribute node (family.ungram rule Attribute).
Implementations§
Source§impl Attribute
impl Attribute
pub fn key(&self) -> Option<Name>
pub fn value(&self) -> Option<AttrValue>
pub fn expr(&self) -> Option<Expr>
pub fn dot_token(&self) -> Option<SyntaxToken>
pub fn eq_token(&self) -> Option<SyntaxToken>
pub fn require_token(&self) -> Option<SyntaxToken>
pub fn ensure_token(&self) -> Option<SyntaxToken>
Source§impl Attribute
impl Attribute
Sourcepub fn key_segments(&self) -> AstChildren<Name> ⓘ
pub fn key_segments(&self) -> AstChildren<Name> ⓘ
The key’s name segments in source order: one for a family key
(labels), two for an rsdl backend key (linux.cpuset, rsdl reference
§5). Empty for a predicate attribute, and for a key the parser held in
an ErrorNode (a reserved word, FORM-105).
Sourcepub fn predicate_kind(&self) -> Option<PredicateKind>
pub fn predicate_kind(&self) -> Option<PredicateKind>
The predicate keyword of a require/ensure attribute; None for
the flag and assignment forms.
Trait Implementations§
Source§impl AstNode for Attribute
impl AstNode for Attribute
Source§fn cast(syntax: SyntaxNode) -> Option<Self>
fn cast(syntax: SyntaxNode) -> Option<Self>
Wraps
syntax if its kind matches this type; None otherwise.Source§fn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
The underlying untyped node.
impl Eq for Attribute
impl StructuralPartialEq for Attribute
Auto Trait Implementations§
impl !RefUnwindSafe for Attribute
impl !Send for Attribute
impl !Sync for Attribute
impl !UnwindSafe for Attribute
impl Freeze for Attribute
impl Unpin for Attribute
impl UnsafeUnpin for Attribute
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