pub struct Conditional { /* private fields */ }Expand description
An \if… … \else … \or … \fi conditional the shape gate paired.
Implementations§
Source§impl Conditional
impl Conditional
Sourcepub fn branches(&self) -> impl Iterator<Item = ConditionalBranch>
pub fn branches(&self) -> impl Iterator<Item = ConditionalBranch>
The branches, in source order — at least one, since the grammar opens a branch before the opener.
Sourcepub fn closer(&self) -> Option<Command>
pub fn closer(&self) -> Option<Command>
The closing \fi, read positionally as the last child node rather than
by matching the name: which control word closes a conditional is the
grammar’s call, and re-deciding it here would be the same meaning check
twice (decision #10). None only if the gate’s guarantee is ever broken,
which callers must tolerate rather than assume away.
Trait Implementations§
Source§impl AstNode for Conditional
impl AstNode for Conditional
fn can_cast(kind: SyntaxKind) -> bool
fn cast(syntax: SyntaxNode) -> Option<Self>
fn syntax(&self) -> &SyntaxNode
Source§impl Clone for Conditional
impl Clone for Conditional
Source§fn clone(&self) -> Conditional
fn clone(&self) -> Conditional
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 Conditional
impl Debug for Conditional
impl Eq for Conditional
Source§impl Hash for Conditional
impl Hash for Conditional
Source§impl PartialEq for Conditional
impl PartialEq for Conditional
impl StructuralPartialEq for Conditional
Auto Trait Implementations§
impl !RefUnwindSafe for Conditional
impl !Send for Conditional
impl !Sync for Conditional
impl !UnwindSafe for Conditional
impl Freeze for Conditional
impl Unpin for Conditional
impl UnsafeUnpin for Conditional
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