pub enum Expr {
Show 23 variants
ExprUn(ExprUnType),
ExprBin(ExprBinType),
ExprLitChar(ExprLitCharType),
ExprLitInt(ExprLitIntType),
ExprLitFloat(ExprLitFloatType),
ExprLitStr(ExprLitStrType),
ExprTemplate(ExprTemplateType),
ExprLitBool(ExprLitBoolType),
ExprIdent(ExprIdentType),
ExprCall(ExprCallType),
ExprTypeParam(ExprTypeParamType),
ExprPath(ExprPathType),
ExprDelegation(ExprDelegationType),
ExprDot(ExprDotType),
ExprSelf(ExprSelfType),
ExprSuper(ExprSuperType),
ExprNil(ExprNilType),
ExprConv(ExprConvType),
ExprTry(ExprTryType),
ExprLambda(ExprLambdaType),
ExprBlock(ExprBlockType),
ExprIf(ExprIfType),
ExprTuple(ExprTupleType),
}
Variants§
ExprUn(ExprUnType)
ExprBin(ExprBinType)
ExprLitChar(ExprLitCharType)
ExprLitInt(ExprLitIntType)
ExprLitFloat(ExprLitFloatType)
ExprLitStr(ExprLitStrType)
ExprTemplate(ExprTemplateType)
ExprLitBool(ExprLitBoolType)
ExprIdent(ExprIdentType)
ExprCall(ExprCallType)
ExprTypeParam(ExprTypeParamType)
ExprPath(ExprPathType)
ExprDelegation(ExprDelegationType)
ExprDot(ExprDotType)
ExprSelf(ExprSelfType)
ExprSuper(ExprSuperType)
ExprNil(ExprNilType)
ExprConv(ExprConvType)
ExprTry(ExprTryType)
ExprLambda(ExprLambdaType)
ExprBlock(ExprBlockType)
ExprIf(ExprIfType)
ExprTuple(ExprTupleType)
Implementations§
Source§impl Expr
impl Expr
pub fn create_block( id: NodeId, pos: Position, span: Span, stmts: Vec<Box<Stmt>>, expr: Option<Box<Expr>>, ) -> Expr
pub fn create_if( id: NodeId, pos: Position, span: Span, cond: Box<Expr>, then_block: Box<Expr>, else_block: Option<Box<Expr>>, ) -> Expr
pub fn create_un( id: NodeId, pos: Position, span: Span, op: UnOp, opnd: Box<Expr>, ) -> Expr
pub fn create_try( id: NodeId, pos: Position, span: Span, expr: Box<Expr>, mode: TryMode, ) -> Expr
pub fn create_bin( id: NodeId, pos: Position, span: Span, op: BinOp, lhs: Box<Expr>, rhs: Box<Expr>, ) -> Expr
pub fn create_conv( id: NodeId, pos: Position, span: Span, object: Box<Expr>, data_type: Box<Type>, is: bool, ) -> Expr
pub fn create_lit_char( id: NodeId, pos: Position, span: Span, value: char, ) -> Expr
pub fn create_lit_int( id: NodeId, pos: Position, span: Span, value: u64, base: IntBase, suffix: IntSuffix, ) -> Expr
pub fn create_lit_float( id: NodeId, pos: Position, span: Span, value: f64, suffix: FloatSuffix, ) -> Expr
pub fn create_lit_str( id: NodeId, pos: Position, span: Span, value: String, ) -> Expr
pub fn create_template( id: NodeId, pos: Position, span: Span, parts: Vec<Box<Expr>>, ) -> Expr
pub fn create_lit_bool( id: NodeId, pos: Position, span: Span, value: bool, ) -> Expr
pub fn create_this(id: NodeId, pos: Position, span: Span) -> Expr
pub fn create_super(id: NodeId, pos: Position, span: Span) -> Expr
pub fn create_nil(id: NodeId, pos: Position, span: Span) -> Expr
pub fn create_ident( id: NodeId, pos: Position, span: Span, name: Name, type_params: Option<Vec<Type>>, ) -> Expr
pub fn create_call( id: NodeId, pos: Position, span: Span, callee: Box<Expr>, args: Vec<Box<Expr>>, ) -> Expr
pub fn create_type_param( id: NodeId, pos: Position, span: Span, callee: Box<Expr>, args: Vec<Type>, ) -> Expr
pub fn create_path( id: NodeId, pos: Position, span: Span, lhs: Box<Expr>, rhs: Box<Expr>, ) -> Expr
pub fn create_delegation( id: NodeId, pos: Position, span: Span, args: Vec<Box<Expr>>, ) -> Expr
pub fn create_dot( id: NodeId, pos: Position, span: Span, lhs: Box<Expr>, rhs: Box<Expr>, ) -> Expr
pub fn create_lambda( id: NodeId, pos: Position, span: Span, params: Vec<Param>, ret: Option<Box<Type>>, block: Box<Stmt>, ) -> Expr
pub fn create_tuple( id: NodeId, pos: Position, span: Span, values: Vec<Box<Expr>>, ) -> Expr
pub fn to_un(&self) -> Option<&ExprUnType>
pub fn is_un(&self) -> bool
pub fn to_bin(&self) -> Option<&ExprBinType>
pub fn is_bin(&self) -> bool
pub fn to_ident(&self) -> Option<&ExprIdentType>
pub fn is_ident(&self) -> bool
pub fn to_call(&self) -> Option<&ExprCallType>
pub fn is_call(&self) -> bool
pub fn to_path(&self) -> Option<&ExprPathType>
pub fn is_path(&self) -> bool
pub fn to_type_param(&self) -> Option<&ExprTypeParamType>
pub fn is_type_param(&self) -> bool
pub fn to_lit_char(&self) -> Option<&ExprLitCharType>
pub fn is_lit_char(&self) -> bool
pub fn to_lit_int(&self) -> Option<&ExprLitIntType>
pub fn is_lit_int(&self) -> bool
pub fn to_template(&self) -> Option<&ExprTemplateType>
pub fn is_template(&self) -> bool
pub fn to_lit_float(&self) -> Option<&ExprLitFloatType>
pub fn is_lit_float(&self) -> bool
pub fn to_lit_str(&self) -> Option<&ExprLitStrType>
pub fn is_lit_str(&self) -> bool
pub fn to_lit_bool(&self) -> Option<&ExprLitBoolType>
pub fn is_lit_bool(&self) -> bool
pub fn is_lit_true(&self) -> bool
pub fn to_dot(&self) -> Option<&ExprDotType>
pub fn is_dot(&self) -> bool
pub fn to_delegation(&self) -> Option<&ExprDelegationType>
pub fn is_delegation(&self) -> bool
pub fn is_this(&self) -> bool
pub fn is_super(&self) -> bool
pub fn to_super(&self) -> Option<&ExprSuperType>
pub fn is_nil(&self) -> bool
pub fn to_conv(&self) -> Option<&ExprConvType>
pub fn is_conv(&self) -> bool
pub fn to_try(&self) -> Option<&ExprTryType>
pub fn is_try(&self) -> bool
pub fn to_lambda(&self) -> Option<&ExprLambdaType>
pub fn is_lambda(&self) -> bool
pub fn to_tuple(&self) -> Option<&ExprTupleType>
pub fn is_tuple(&self) -> bool
pub fn to_block(&self) -> Option<&ExprBlockType>
pub fn is_block(&self) -> bool
pub fn to_if(&self) -> Option<&ExprIfType>
pub fn is_if(&self) -> bool
pub fn needs_semicolon(&self) -> bool
pub fn pos(&self) -> Position
pub fn span(&self) -> Span
pub fn id(&self) -> NodeId
Trait Implementations§
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<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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)