sdml_core::model::walk

Trait SimpleModuleVisitor

source
pub trait SimpleModuleVisitor {
    const INCLUDE_NESTED: Result<bool, Error> = _;
    const NO_NESTED: Result<bool, Error> = _;
Show 41 methods // Provided methods fn module_start(&mut self, _thing: &Module) -> Result<bool, Error> { ... } fn module_end(&mut self, _thing: &Module) -> Result<(), Error> { ... } fn import_statement_start( &mut self, _thing: &ImportStatement, ) -> Result<bool, Error> { ... } fn import_statement_end( &mut self, _thing: &ImportStatement, ) -> Result<(), Error> { ... } fn module_import(&mut self, _thing: &ModuleImport) -> Result<(), Error> { ... } fn member_import( &mut self, _thing: &QualifiedIdentifier, ) -> Result<(), Error> { ... } fn annotation_start(&mut self, _thing: &Annotation) -> Result<bool, Error> { ... } fn annotation_end(&mut self, _thing: &Annotation) -> Result<(), Error> { ... } fn annotation_property( &mut self, _thing: &AnnotationProperty, ) -> Result<(), Error> { ... } fn informal_constraint( &mut self, _thing: &ControlledLanguageString, ) -> Result<(), Error> { ... } fn formal_constraint( &mut self, _thing: &FormalConstraint, ) -> Result<(), Error> { ... } fn definition_start(&mut self, _thing: &Definition) -> Result<bool, Error> { ... } fn definition_end(&mut self, _thing: &Definition) -> Result<(), Error> { ... } fn datatype_start(&mut self, _thing: &DatatypeDef) -> Result<bool, Error> { ... } fn datatype_end(&mut self, _thing: &DatatypeDef) -> Result<(), Error> { ... } fn entity_start(&mut self, _thing: &EntityDef) -> Result<bool, Error> { ... } fn entity_end(&mut self, _thing: &EntityDef) -> Result<(), Error> { ... } fn enum_start(&mut self, _thing: &EnumDef) -> Result<bool, Error> { ... } fn enum_end(&mut self, _thing: &EnumDef) -> Result<(), Error> { ... } fn event_start(&mut self, _thing: &EventDef) -> Result<bool, Error> { ... } fn event_end(&mut self, _thing: &EventDef) -> Result<(), Error> { ... } fn property_start(&mut self, _thing: &PropertyDef) -> Result<bool, Error> { ... } fn property_end(&mut self, _thing: &PropertyDef) -> Result<(), Error> { ... } fn rdf_start(&mut self, _thing: &RdfDef) -> Result<bool, Error> { ... } fn rdf_end(&mut self, _thing: &RdfDef) -> Result<(), Error> { ... } fn structure_start(&mut self, _thing: &StructureDef) -> Result<bool, Error> { ... } fn structure_end(&mut self, _thing: &StructureDef) -> Result<(), Error> { ... } fn union_start(&mut self, _thing: &UnionDef) -> Result<bool, Error> { ... } fn union_end(&mut self, _thing: &UnionDef) -> Result<(), Error> { ... } fn member_start(&mut self, _thing: &Member) -> Result<bool, Error> { ... } fn member_end(&mut self, _thing: &Member) -> Result<(), Error> { ... } fn identity_member_start(&mut self, _thing: &Member) -> Result<bool, Error> { ... } fn identity_member_end(&mut self, _thing: &Member) -> Result<(), Error> { ... } fn member_definition_start( &mut self, _thing: &MemberDef, ) -> Result<bool, Error> { ... } fn member_definition_end(&mut self, _thing: &MemberDef) -> Result<(), Error> { ... } fn property_reference_start( &mut self, _thing: &IdentifierReference, ) -> Result<bool, Error> { ... } fn property_reference_end( &mut self, _thing: &IdentifierReference, ) -> Result<(), Error> { ... } fn value_variant_start( &mut self, _thing: &ValueVariant, ) -> Result<bool, Error> { ... } fn value_variant_end(&mut self, _thing: &ValueVariant) -> Result<(), Error> { ... } fn type_variant_start( &mut self, _thing: &TypeVariant, ) -> Result<bool, Error> { ... } fn type_variant_end(&mut self, _thing: &TypeVariant) -> Result<(), Error> { ... }
}
Expand description

The trait that captures the callbacks that walk_module_simple uses as it traverses the module.

Some functions return a boolean, this indicates whether the walker should continue into any nested structure for that model element. For example if structure_start returns false then no annotations or members within that structure instance will be walked. Note that this also removes the corresponding structure_end as well.

Provided Associated Constants§

Provided Methods§

source

fn module_start(&mut self, _thing: &Module) -> Result<bool, Error>

Called to denote the start of a Module instance.

§Nested Calls
  • import once for each import statement
  • annotation_start once for each annotation on the module
  • definition_start once for each definition in the module
  • module_end once, when imports, annotations, and definitions are complete
source

fn module_end(&mut self, _thing: &Module) -> Result<(), Error>

Called to denote the end of a Module instance.

§Nested

None.

source

fn import_statement_start( &mut self, _thing: &ImportStatement, ) -> Result<bool, Error>

Called to denote the start of an ImportStatement instance.

§Nested
  • module_import
  • member_import
source

fn import_statement_end( &mut self, _thing: &ImportStatement, ) -> Result<(), Error>

Called to denote the end of an ImportStatement instance.

§Nested

None.

source

fn module_import(&mut self, _thing: &ModuleImport) -> Result<(), Error>

Called to handle a ModuleImport instance.

§Nested

None.

source

fn member_import(&mut self, _thing: &QualifiedIdentifier) -> Result<(), Error>

Called to handle a Qualifiedidentifier instance.

§Nested

None.

source

fn annotation_start(&mut self, _thing: &Annotation) -> Result<bool, Error>

Called to denote the start of an Annotation instance.

§Nested
  • annotation_property
  • informal_constraint
  • formal_constraint
  • annotation_end
source

fn annotation_end(&mut self, _thing: &Annotation) -> Result<(), Error>

Called to denote the end of an Annotation instance.

§Nested

None.

source

fn annotation_property( &mut self, _thing: &AnnotationProperty, ) -> Result<(), Error>

Called to handle a AnnotationProperty instance.

§Nested

None.

source

fn informal_constraint( &mut self, _thing: &ControlledLanguageString, ) -> Result<(), Error>

Called to handle a ControlledLanguageString instance.

§Nested

None.

source

fn formal_constraint(&mut self, _thing: &FormalConstraint) -> Result<(), Error>

Called to handle a FormalConstraint instance.

§Nested

None.

source

fn definition_start(&mut self, _thing: &Definition) -> Result<bool, Error>

Called to denote the start of a Definition instance.

§Nested
  • datatype_start
  • entity_start
  • enum_start
  • event_start
  • property_start
  • rdf_start
  • structure_start
  • union_start
  • definition_end
source

fn definition_end(&mut self, _thing: &Definition) -> Result<(), Error>

Called to denote the end of a Definition instance.

§Nested

None

source

fn datatype_start(&mut self, _thing: &DatatypeDef) -> Result<bool, Error>

Called to denote the start of a DatatypeDef instance.

§Nested
  • annotation_start
  • datatype_end
source

fn datatype_end(&mut self, _thing: &DatatypeDef) -> Result<(), Error>

Called to denote the end of a DatatypeDef instance.

§Nested

None.

source

fn entity_start(&mut self, _thing: &EntityDef) -> Result<bool, Error>

Called to denote the start of an EntityDef instance.

§Nested
  • annotation_start
  • identity_member_start
  • member_start
  • entity_end
source

fn entity_end(&mut self, _thing: &EntityDef) -> Result<(), Error>

Called to denote the end of an EntityDef instance.

§Nested

None.

source

fn enum_start(&mut self, _thing: &EnumDef) -> Result<bool, Error>

Called to denote the start of an EnumDef instance.

§Nested
  • annotation_start
  • value_variant_start
  • enum_end
source

fn enum_end(&mut self, _thing: &EnumDef) -> Result<(), Error>

Called to denote the end of an EnumDef instance.

§Nested

None.

source

fn event_start(&mut self, _thing: &EventDef) -> Result<bool, Error>

Called to denote the start of an EventDef instance.

§Nested
  • annotation_start
  • member_start
  • event_end
source

fn event_end(&mut self, _thing: &EventDef) -> Result<(), Error>

Called to denote the end of an EventDef instance.

§Nested

None.

source

fn property_start(&mut self, _thing: &PropertyDef) -> Result<bool, Error>

Called to denote the start of a PropertyDev instance.

§Nested
  • member_definition_start
  • property_end
source

fn property_end(&mut self, _thing: &PropertyDef) -> Result<(), Error>

Called to denote the end of a PropertyDef instance.

§Nested

None.

source

fn rdf_start(&mut self, _thing: &RdfDef) -> Result<bool, Error>

Called to denote the start of a RdfDef instance.

§Nested
  • annotation_start
  • rdf_end
source

fn rdf_end(&mut self, _thing: &RdfDef) -> Result<(), Error>

Called to denote the end of a RdfDef instance.

§Nested

None.

source

fn structure_start(&mut self, _thing: &StructureDef) -> Result<bool, Error>

Called to denote the start of a StructureDef instance.

§Nested
  • annotation_start
  • member_start
  • structure_end
source

fn structure_end(&mut self, _thing: &StructureDef) -> Result<(), Error>

Called to denote the end of a StructureDef instance.

§Nested

None.

source

fn union_start(&mut self, _thing: &UnionDef) -> Result<bool, Error>

Called to denote the start of an UnionDef instance.

§Nested
  • annotation_start
  • type_variant_start
  • union_end
source

fn union_end(&mut self, _thing: &UnionDef) -> Result<(), Error>

Called to denote the end of an UnionDef instance.

§Nested

None.

source

fn member_start(&mut self, _thing: &Member) -> Result<bool, Error>

Called to denote the start of a Member instance.

§Nested
  • property_reference_start
  • member_definition_start
  • member_end
source

fn member_end(&mut self, _thing: &Member) -> Result<(), Error>

Called to denote the end of a Member instance.

§Nested

None.

source

fn identity_member_start(&mut self, _thing: &Member) -> Result<bool, Error>

Called to denote the start of an identity Member instance.

§Nested
  • property_reference_start
  • member_definition_start
  • identity_member_end
source

fn identity_member_end(&mut self, _thing: &Member) -> Result<(), Error>

Called to denote the end of an identity Member instance.

§Nested

None.

source

fn member_definition_start(&mut self, _thing: &MemberDef) -> Result<bool, Error>

Called to denote the start of a MemberDef instance.

§Nested
  • annotation_start
  • member_definition_end
source

fn member_definition_end(&mut self, _thing: &MemberDef) -> Result<(), Error>

Called to denote the end of a MemberDef instance.

§Nested

None.

source

fn property_reference_start( &mut self, _thing: &IdentifierReference, ) -> Result<bool, Error>

Called to denote the start of a member reference IdentifierReference instance.

§Nested
  • property_reference_end
source

fn property_reference_end( &mut self, _thing: &IdentifierReference, ) -> Result<(), Error>

Called to denote the end of a member reference IdentifierReference instance.

§Nested

None.

source

fn value_variant_start(&mut self, _thing: &ValueVariant) -> Result<bool, Error>

Called to denote the start of a ValueVariant instance.

§Nested
  • annotation_start
  • value_variant_end
source

fn value_variant_end(&mut self, _thing: &ValueVariant) -> Result<(), Error>

Called to denote the end of a ValueVariant instance.

§Nested

None.

source

fn type_variant_start(&mut self, _thing: &TypeVariant) -> Result<bool, Error>

Called to denote the start of a TypeVarian instance.

§Nested
  • annotation_start
  • type_variant_end
source

fn type_variant_end(&mut self, _thing: &TypeVariant) -> Result<(), Error>

Called to denote the end of a TypeVariant instance.

§Nested

None.

Object Safety§

This trait is not object safe.

Implementors§