WalkVisitor

Trait WalkVisitor 

Source
pub trait WalkVisitor {
    // Required methods
    fn item(
        &mut self,
        item: &DecodedEntity,
        at: &WalkCtx<'_>,
        decoder: &mut EntityDecoder<'_>,
    ) -> Flow;
    fn refused(
        &mut self,
        item: &DecodedEntity,
        why: WalkRefusal,
        ctx: &WalkCtx<'_>,
    );

    // Provided methods
    fn shape_rep(&mut self, _rep: &DecodedEntity) -> Flow { ... }
    fn enter_map(
        &mut self,
        _level: &MappedLevel,
        _at: &WalkCtx<'_>,
        _decoder: &mut EntityDecoder<'_>,
    ) -> Flow { ... }
    fn leave_map(&mut self, _level: &MappedLevel) { ... }
}

Required Methods§

Source

fn item( &mut self, item: &DecodedEntity, at: &WalkCtx<'_>, decoder: &mut EntityDecoder<'_>, ) -> Flow

A representation item. Under every policy but NestedMaps::Leaf it is never an IfcMappedItem.

Source

fn refused(&mut self, item: &DecodedEntity, why: WalkRefusal, ctx: &WalkCtx<'_>)

A refused mapped item, or the holding representation for a root-list budget refusal. ctx.path excludes the refused level. Nested Items failures follow enter_map and are paired with leave_map; source, depth, cycle and level-budget failures occur before entry. Implementors must report refusal or explicitly abstain; Ok(()) does not certify that every item was visited.

Provided Methods§

Source

fn shape_rep(&mut self, _rep: &DecodedEntity) -> Flow

A representation of the product, before its items.

Source

fn enter_map( &mut self, _level: &MappedLevel, _at: &WalkCtx<'_>, _decoder: &mut EntityDecoder<'_>, ) -> Flow

The source and mapped representation resolved. Only Continue reads, charges and decodes its Items, after this callback; SkipChildren and Stop suppress those operations and their errors. The level entities are snapshots, but child references resolve through the decoder as mutated by this callback.

Source

fn leave_map(&mut self, _level: &MappedLevel)

Pairs every enter_map, whatever it answered and however the level’s items ended.

Implementors§