pub struct MappingWalker { /* private fields */ }Expand description
Walks mapped-item nesting, detecting cycles and excessive depth.
Separate from the views because the views are stateless borrows while a safe walk needs to remember where it has been.
Implementations§
Source§impl MappingWalker
impl MappingWalker
Sourcepub fn enter(&mut self, item: EntityId) -> GeometryResult<()>
pub fn enter(&mut self, item: EntityId) -> GeometryResult<()>
Enter a mapped item, or fail if that would revisit or go too deep.
Call Self::exit when done with the item, so sibling instances of
the same map do not look like a cycle. A map legitimately appears many
times; what is illegal is a map containing itself.
Sourcepub fn resolve(
&mut self,
model: &Model,
item_id: EntityId,
) -> GeometryResult<MappedInstance>
pub fn resolve( &mut self, model: &Model, item_id: EntityId, ) -> GeometryResult<MappedInstance>
Resolve the source map and target operator of a mapped item.
Returns both ids so a caller can compose MappingOrigin with
MappingTarget. Composing only the target is the bug this signature
is shaped to prevent.
Trait Implementations§
Source§impl Debug for MappingWalker
impl Debug for MappingWalker
Auto Trait Implementations§
impl Freeze for MappingWalker
impl RefUnwindSafe for MappingWalker
impl Send for MappingWalker
impl Sync for MappingWalker
impl Unpin for MappingWalker
impl UnsafeUnpin for MappingWalker
impl UnwindSafe for MappingWalker
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