pub enum Expr {
Show 21 variants
ArrayExpr(ArrayExpr),
ArrayLiteral(ArrayLiteral),
BinExpr(BinExpr),
BlockExpr(BlockExpr),
BoxExpr(BoxExpr),
CallExpr(CallExpr),
CastExpression(CastExpression),
GateCallExpr(GateCallExpr),
GPhaseCallExpr(GPhaseCallExpr),
HardwareQubit(HardwareQubit),
Identifier(Identifier),
IndexExpr(IndexExpr),
IndexedIdentifier(IndexedIdentifier),
Literal(Literal),
TimingLiteral(TimingLiteral),
MeasureExpression(MeasureExpression),
ModifiedGateCallExpr(ModifiedGateCallExpr),
ParenExpr(ParenExpr),
PrefixExpr(PrefixExpr),
RangeExpr(RangeExpr),
ReturnExpr(ReturnExpr),
}Variants§
ArrayExpr(ArrayExpr)
ArrayLiteral(ArrayLiteral)
BinExpr(BinExpr)
BlockExpr(BlockExpr)
BoxExpr(BoxExpr)
CallExpr(CallExpr)
CastExpression(CastExpression)
GateCallExpr(GateCallExpr)
GPhaseCallExpr(GPhaseCallExpr)
HardwareQubit(HardwareQubit)
Identifier(Identifier)
IndexExpr(IndexExpr)
IndexedIdentifier(IndexedIdentifier)
Literal(Literal)
TimingLiteral(TimingLiteral)
MeasureExpression(MeasureExpression)
ModifiedGateCallExpr(ModifiedGateCallExpr)
ParenExpr(ParenExpr)
PrefixExpr(PrefixExpr)
RangeExpr(RangeExpr)
ReturnExpr(ReturnExpr)
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn needs_parens_in(&self, parent: SyntaxNode) -> bool
pub fn needs_parens_in(&self, parent: SyntaxNode) -> bool
Returns true if self would need to be wrapped in parentheses given that its parent is parent.
Trait Implementations§
Source§impl AstNode for Expr
impl AstNode for Expr
fn can_cast(kind: SyntaxKind) -> bool
fn cast(syntax: SyntaxNode) -> Option<Self>
fn syntax(&self) -> &SyntaxNode
fn clone_for_update(&self) -> Selfwhere
Self: Sized,
fn clone_subtree(&self) -> Selfwhere
Self: Sized,
Source§impl From<ArrayLiteral> for Expr
impl From<ArrayLiteral> for Expr
Source§fn from(node: ArrayLiteral) -> Expr
fn from(node: ArrayLiteral) -> Expr
Converts to this type from the input type.
Source§impl From<CastExpression> for Expr
impl From<CastExpression> for Expr
Source§fn from(node: CastExpression) -> Expr
fn from(node: CastExpression) -> Expr
Converts to this type from the input type.
Source§impl From<GPhaseCallExpr> for Expr
impl From<GPhaseCallExpr> for Expr
Source§fn from(node: GPhaseCallExpr) -> Expr
fn from(node: GPhaseCallExpr) -> Expr
Converts to this type from the input type.
Source§impl From<GateCallExpr> for Expr
impl From<GateCallExpr> for Expr
Source§fn from(node: GateCallExpr) -> Expr
fn from(node: GateCallExpr) -> Expr
Converts to this type from the input type.
Source§impl From<HardwareQubit> for Expr
impl From<HardwareQubit> for Expr
Source§fn from(node: HardwareQubit) -> Expr
fn from(node: HardwareQubit) -> Expr
Converts to this type from the input type.
Source§impl From<Identifier> for Expr
impl From<Identifier> for Expr
Source§fn from(node: Identifier) -> Expr
fn from(node: Identifier) -> Expr
Converts to this type from the input type.
Source§impl From<IndexedIdentifier> for Expr
impl From<IndexedIdentifier> for Expr
Source§fn from(node: IndexedIdentifier) -> Expr
fn from(node: IndexedIdentifier) -> Expr
Converts to this type from the input type.
Source§impl From<MeasureExpression> for Expr
impl From<MeasureExpression> for Expr
Source§fn from(node: MeasureExpression) -> Expr
fn from(node: MeasureExpression) -> Expr
Converts to this type from the input type.
Source§impl From<ModifiedGateCallExpr> for Expr
impl From<ModifiedGateCallExpr> for Expr
Source§fn from(node: ModifiedGateCallExpr) -> Expr
fn from(node: ModifiedGateCallExpr) -> Expr
Converts to this type from the input type.
Source§impl From<PrefixExpr> for Expr
impl From<PrefixExpr> for Expr
Source§fn from(node: PrefixExpr) -> Expr
fn from(node: PrefixExpr) -> Expr
Converts to this type from the input type.
Source§impl From<ReturnExpr> for Expr
impl From<ReturnExpr> for Expr
Source§fn from(node: ReturnExpr) -> Expr
fn from(node: ReturnExpr) -> Expr
Converts to this type from the input type.
Source§impl From<TimingLiteral> for Expr
impl From<TimingLiteral> for Expr
Source§fn from(node: TimingLiteral) -> Expr
fn from(node: TimingLiteral) -> Expr
Converts to this type from the input type.
impl Eq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl !RefUnwindSafe for Expr
impl !Send for Expr
impl !Sync for Expr
impl Unpin for Expr
impl !UnwindSafe for Expr
Blanket Implementations§
Source§impl<N> AstNodeEdit for N
impl<N> AstNodeEdit for N
fn indent_level(&self) -> IndentLevel
fn indent(&self, level: IndentLevel) -> Self
fn dedent(&self, level: IndentLevel) -> Self
fn reset_indent(&self) -> Self
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more