Skip to content

Trait Rework: VisitationMap #557

@indietyp

Description

@indietyp

The name is very WIP, but to allow for greater flexibility, instead of implementing Visitable on maps we create a new trait that is instead implemented on the set instead. The name is currently very tbd and likely to change.

pub enum VisitationStatus {
	AlreadyVisited,
	NewlyVisited
}

// TODO: name is not great
pub trait VisitationMap<G> {
	type Index;

	fn new(graph: &G) -> Self;

	fn visit(&mut self, node: Self::Index) -> VisitationStatus;
	fn is_visited(&self, node: Self::Index) -> bool;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions