pub struct ConstructEntry { /* private fields */ }Implementations§
Source§impl ConstructEntry
impl ConstructEntry
Sourcepub fn is_pair(&self) -> bool
pub fn is_pair(&self) -> bool
true for the pair/field form (k: v), false for the element
form (v) — read off the COLON token the parser emits between the
two expressions, so it never depends on child-count guessing.
Sourcepub fn key(&self) -> Option<SyntaxNode>
pub fn key(&self) -> Option<SyntaxNode>
The left-hand expression of a pair/field entry (k in k: v), or
None for the element form.
Sourcepub fn value(&self) -> Option<SyntaxNode>
pub fn value(&self) -> Option<SyntaxNode>
The entry’s value expression: the right-hand side of a pair/field entry, or the single expression of an element entry.
Trait Implementations§
Source§impl AstNode for ConstructEntry
impl AstNode for ConstructEntry
Source§fn can_cast(kind: SyntaxKind) -> bool
fn can_cast(kind: SyntaxKind) -> bool
Returns
true for a node with a SyntaxKind this type can wrap.Source§fn cast(node: SyntaxNode) -> Option<Self>
fn cast(node: SyntaxNode) -> Option<Self>
Try to cast a generic
SyntaxNode into this typed wrapper.Source§fn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
Access the underlying
SyntaxNode.Source§impl Clone for ConstructEntry
impl Clone for ConstructEntry
Source§fn clone(&self) -> ConstructEntry
fn clone(&self) -> ConstructEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConstructEntry
impl Debug for ConstructEntry
Source§impl Display for ConstructEntry
impl Display for ConstructEntry
impl Eq for ConstructEntry
Source§impl Hash for ConstructEntry
impl Hash for ConstructEntry
Source§impl PartialEq for ConstructEntry
impl PartialEq for ConstructEntry
impl StructuralPartialEq for ConstructEntry
Auto Trait Implementations§
impl !RefUnwindSafe for ConstructEntry
impl !Send for ConstructEntry
impl !Sync for ConstructEntry
impl !UnwindSafe for ConstructEntry
impl Freeze for ConstructEntry
impl Unpin for ConstructEntry
impl UnsafeUnpin for ConstructEntry
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