pub trait AstDebug {
    // Required method
    fn ast_debug(&self, w: &mut AstWriter);
}
Expand description

Simple trait used for pretty printing the various AST

Unfortunately, the trait implementation cannot be derived. The actual implementation should closely resemble the source syntax. As suchfield does not get printed in a direct manner, and most of the logic is ad hoc

To avoid missing fields in the printing, be sure to fully pattern match against the struct (without the use of ..) when implementing AstDebug. For example,

impl AstDebug for StructDefinition {
    fn ast_debug(&self, w: &mut AstWriter) {
        let StructDefinition {
            resource_opt,
            name,
            type_parameters,
            fields,
        } = self;
        ...
    }
}

Required Methods§

source

fn ast_debug(&self, w: &mut AstWriter)

Implementations on Foreign Types§

source§

impl AstDebug for Vec<Option<Type>>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<Attribute>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (&Label, &BasicBlock)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (FunctionName, &Function)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<Type>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (FunctionName, &Function)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<(Name, AbilitySet)>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (ConstantName, &Constant)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<LValue>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<LValueWithRange>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<Type>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<SingleType>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (FunctionName, &Function)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (LValue, Exp)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<StructTypeParameter>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<BaseType>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl<T: AstDebug> AstDebug for Spanned<T>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<LValue>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (&UniqueMap<Var, SingleType>, &Block)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for MoveValue

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (Bind, Exp)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (Name, AbilitySet)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<BindWithRange>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<Attributes>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl<T: AstDebug> AstDebug for Box<T>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (ConstantName, &Constant)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<Attribute>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (Name, Vec<Ability>)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (Block, Box<Exp>)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<TParam>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for VecDeque<SequenceItem>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<StructTypeParameter>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for VecDeque<SequenceItem>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for VecDeque<SequenceItem>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<StructTypeParameter>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (ConstantName, &Constant)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (ConstantName, &Constant)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (FunctionName, &Function)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for VecDeque<Statement>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<Type>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (FunctionName, &Function)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<Bind>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<Vec<Exp>>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (StructName, &StructDefinition)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (Vec<UseDecl>, Vec<SequenceItem>, Option<Loc>, Box<Option<Exp>>)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<Vec<Exp>>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (ConstantName, &Constant)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (UniqueMap<Var, SingleType>, Block)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (StructName, &StructDefinition)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for (StructName, &StructDefinition)

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<LValue>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<LValue>

source§

fn ast_debug(&self, w: &mut AstWriter)

source§

impl AstDebug for Vec<(Name, Vec<Ability>)>

source§

fn ast_debug(&self, w: &mut AstWriter)

Implementors§

source§

impl AstDebug for move_lang::expansion::ast::AttributeValue_

source§

impl AstDebug for move_lang::expansion::ast::Attribute_

source§

impl AstDebug for move_lang::expansion::ast::ExpDotted_

source§

impl AstDebug for move_lang::expansion::ast::Exp_

source§

impl AstDebug for move_lang::expansion::ast::LValue_

source§

impl AstDebug for ModuleAccess_

source§

impl AstDebug for move_lang::expansion::ast::SequenceItem_

source§

impl AstDebug for move_lang::expansion::ast::SpecBlockMember_

source§

impl AstDebug for move_lang::expansion::ast::SpecBlockTarget_

source§

impl AstDebug for move_lang::expansion::ast::SpecConditionKind_

source§

impl AstDebug for move_lang::expansion::ast::Type_

source§

impl AstDebug for move_lang::expansion::ast::Value_

source§

impl AstDebug for BaseType_

source§

impl AstDebug for move_lang::hlir::ast::BuiltinFunction_

source§

impl AstDebug for Command_

source§

impl AstDebug for move_lang::hlir::ast::ExpListItem

source§

impl AstDebug for move_lang::hlir::ast::LValue_

source§

impl AstDebug for SingleType_

source§

impl AstDebug for Statement_

source§

impl AstDebug for move_lang::hlir::ast::TypeName_

source§

impl AstDebug for move_lang::hlir::ast::Type_

source§

impl AstDebug for move_lang::hlir::ast::UnannotatedExp_

source§

impl AstDebug for move_lang::naming::ast::BuiltinFunction_

source§

impl AstDebug for BuiltinTypeName_

source§

impl AstDebug for move_lang::naming::ast::ExpDotted_

source§

impl AstDebug for move_lang::naming::ast::Exp_

source§

impl AstDebug for move_lang::naming::ast::LValue_

source§

impl AstDebug for move_lang::naming::ast::SequenceItem_

source§

impl AstDebug for move_lang::naming::ast::TypeName_

source§

impl AstDebug for move_lang::naming::ast::Type_

source§

impl AstDebug for Ability_

source§

impl AstDebug for move_lang::parser::ast::AttributeValue_

source§

impl AstDebug for move_lang::parser::ast::Attribute_

source§

impl AstDebug for BinOp_

source§

impl AstDebug for Bind_

source§

impl AstDebug for Definition

source§

impl AstDebug for move_lang::parser::ast::Exp_

source§

impl AstDebug for ModuleMember

source§

impl AstDebug for NameAccessChain_

source§

impl AstDebug for QuantKind_

source§

impl AstDebug for move_lang::parser::ast::SequenceItem_

source§

impl AstDebug for SpecApplyFragment_

source§

impl AstDebug for move_lang::parser::ast::SpecBlockMember_

source§

impl AstDebug for move_lang::parser::ast::SpecBlockTarget_

source§

impl AstDebug for move_lang::parser::ast::SpecConditionKind_

source§

impl AstDebug for move_lang::parser::ast::Type_

source§

impl AstDebug for UnaryOp_

source§

impl AstDebug for Use

source§

impl AstDebug for move_lang::parser::ast::Value_

source§

impl AstDebug for Visibility

source§

impl AstDebug for move_lang::typing::ast::BuiltinFunction_

source§

impl AstDebug for move_lang::typing::ast::ExpListItem

source§

impl AstDebug for move_lang::typing::ast::LValue_

source§

impl AstDebug for move_lang::typing::ast::SequenceItem_

source§

impl AstDebug for move_lang::typing::ast::UnannotatedExp_

source§

impl AstDebug for move_lang::cfgir::ast::ModuleDefinition

source§

impl AstDebug for move_lang::cfgir::ast::Program

source§

impl AstDebug for move_lang::cfgir::ast::Script

source§

impl AstDebug for move_lang::expansion::ast::FunctionSignature

source§

impl AstDebug for move_lang::expansion::ast::ModuleDefinition

source§

impl AstDebug for move_lang::expansion::ast::PragmaProperty_

source§

impl AstDebug for move_lang::expansion::ast::Program

source§

impl AstDebug for move_lang::expansion::ast::Script

source§

impl AstDebug for move_lang::expansion::ast::SpecBlock_

source§

impl AstDebug for move_lang::expansion::ast::StructTypeParameter

source§

impl AstDebug for move_lang::hlir::ast::Exp

source§

impl AstDebug for move_lang::hlir::ast::FunctionSignature

source§

impl AstDebug for move_lang::hlir::ast::ModuleCall

source§

impl AstDebug for move_lang::hlir::ast::ModuleDefinition

source§

impl AstDebug for move_lang::hlir::ast::Program

source§

impl AstDebug for move_lang::hlir::ast::Script

source§

impl AstDebug for move_lang::naming::ast::FunctionSignature

source§

impl AstDebug for move_lang::naming::ast::ModuleDefinition

source§

impl AstDebug for move_lang::naming::ast::Program

source§

impl AstDebug for move_lang::naming::ast::Script

source§

impl AstDebug for move_lang::naming::ast::StructTypeParameter

source§

impl AstDebug for TParam

source§

impl AstDebug for AddressDefinition

source§

impl AstDebug for Constant

source§

impl AstDebug for FriendDecl

source§

impl AstDebug for Function

source§

impl AstDebug for move_lang::parser::ast::FunctionSignature

source§

impl AstDebug for move_lang::parser::ast::ModuleDefinition

source§

impl AstDebug for move_lang::parser::ast::PragmaProperty_

source§

impl AstDebug for move_lang::parser::ast::Program

source§

impl AstDebug for move_lang::parser::ast::Script

source§

impl AstDebug for SpecApplyPattern_

source§

impl AstDebug for move_lang::parser::ast::SpecBlock_

source§

impl AstDebug for StructDefinition

source§

impl AstDebug for move_lang::parser::ast::StructTypeParameter

source§

impl AstDebug for UseDecl

source§

impl AstDebug for move_lang::typing::ast::Exp

source§

impl AstDebug for move_lang::typing::ast::ModuleCall

source§

impl AstDebug for move_lang::typing::ast::ModuleDefinition

source§

impl AstDebug for move_lang::typing::ast::Program

source§

impl AstDebug for move_lang::typing::ast::Script

source§

impl AstDebug for BasicBlocks