pub struct ChoiceGuard { /* private fields */ }Implementations§
Source§impl ChoiceGuard
impl ChoiceGuard
Sourcepub fn expr(&self) -> Option<SyntaxNode>
pub fn expr(&self) -> Option<SyntaxNode>
The guard’s condition expression — CHOICE_GUARD’s first child node
(L_BRACE KW_IF expression (AS_BINDING)? R_BRACE; the braces/keyword
are tokens).
Sourcepub fn as_binding(&self) -> Option<AsBinding>
pub fn as_binding(&self) -> Option<AsBinding>
The as NAME binding, when the author wrote one. Implemented
(issue #1508): brink-ir’s choice lowering (hir::Choice::binding)
captures at presentation time via the same OptionBind
frame-slot machinery the statement/template forms already use
(parser/choice.rs::choice_guard’s doc). E146 is retired.
Trait Implementations§
Source§impl AstNode for ChoiceGuard
impl AstNode for ChoiceGuard
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 ChoiceGuard
impl Clone for ChoiceGuard
Source§fn clone(&self) -> ChoiceGuard
fn clone(&self) -> ChoiceGuard
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 ChoiceGuard
impl Debug for ChoiceGuard
Source§impl Display for ChoiceGuard
impl Display for ChoiceGuard
impl Eq for ChoiceGuard
Source§impl Hash for ChoiceGuard
impl Hash for ChoiceGuard
Source§impl PartialEq for ChoiceGuard
impl PartialEq for ChoiceGuard
impl StructuralPartialEq for ChoiceGuard
Auto Trait Implementations§
impl !RefUnwindSafe for ChoiceGuard
impl !Send for ChoiceGuard
impl !Sync for ChoiceGuard
impl !UnwindSafe for ChoiceGuard
impl Freeze for ChoiceGuard
impl Unpin for ChoiceGuard
impl UnsafeUnpin for ChoiceGuard
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