pub struct SkipDuplicates<StoreImpl>where
StoreImpl: GraphStore,{ /* private fields */ }
Expand description
A GraphStore
wrapper that skips nodes that have already been
visited.
This is necessary to avoid repeated work when traversing non-tree graphs (i.e. where a node can have more than one incoming edge).
Implementations§
Source§impl<StoreImpl> SkipDuplicates<StoreImpl>where
StoreImpl: GraphStore,
impl<StoreImpl> SkipDuplicates<StoreImpl>where
StoreImpl: GraphStore,
pub fn new(store: StoreImpl) -> Self
pub fn new_with_visited_nodes( store: StoreImpl, visited: FxHashSet<StoreImpl::Node>, ) -> Self
Source§impl<StoreImpl> SkipDuplicates<StoreImpl>where
StoreImpl: GraphStore,
impl<StoreImpl> SkipDuplicates<StoreImpl>where
StoreImpl: GraphStore,
Sourcepub fn into_inner(self) -> StoreImpl
pub fn into_inner(self) -> StoreImpl
Consumes the wrapper and returns the underlying store.
Sourcepub fn into_inner_with_visited(
self,
) -> (StoreImpl, VisitedNodes<StoreImpl::Node>)
pub fn into_inner_with_visited( self, ) -> (StoreImpl, VisitedNodes<StoreImpl::Node>)
Consumes the wrapper and returns the underlying store along with the visited nodes.
Trait Implementations§
Source§impl<StoreImpl> Debug for SkipDuplicates<StoreImpl>
impl<StoreImpl> Debug for SkipDuplicates<StoreImpl>
Source§impl<StoreImpl> GraphStore for SkipDuplicates<StoreImpl>
impl<StoreImpl> GraphStore for SkipDuplicates<StoreImpl>
type Node = <StoreImpl as GraphStore>::Node
type Handle = <StoreImpl as GraphStore>::Handle
Auto Trait Implementations§
impl<StoreImpl> Freeze for SkipDuplicates<StoreImpl>where
StoreImpl: Freeze,
impl<StoreImpl> RefUnwindSafe for SkipDuplicates<StoreImpl>
impl<StoreImpl> Send for SkipDuplicates<StoreImpl>
impl<StoreImpl> Sync for SkipDuplicates<StoreImpl>
impl<StoreImpl> Unpin for SkipDuplicates<StoreImpl>
impl<StoreImpl> UnwindSafe for SkipDuplicates<StoreImpl>
Blanket Implementations§
§impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
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
Source§impl<Store> GraphTraversal for Storewhere
Store: GraphStore,
impl<Store> GraphTraversal for Storewhere
Store: GraphStore,
Source§fn visit<VisitImpl, Abort, Impl>(
self,
root_edges: impl IntoIterator<Item = <VisitImpl as Visit<<Store as GraphStore>::Node, Abort, Impl>>::Edge>,
visit: VisitImpl,
) -> impl Future<Output = GraphTraversalResult<Result<Store, Error>, Abort>> + Send
fn visit<VisitImpl, Abort, Impl>( self, root_edges: impl IntoIterator<Item = <VisitImpl as Visit<<Store as GraphStore>::Node, Abort, Impl>>::Edge>, visit: VisitImpl, ) -> impl Future<Output = GraphTraversalResult<Result<Store, Error>, Abort>> + Send
Visits the graph starting from the given roots
, and returns a future
that will resolve to the traversal result.
fn skip_duplicates(self) -> SkipDuplicates<Store>
fn skip_duplicates_with_visited_nodes( self, visited: VisitedNodes<<Store as GraphStore>::Node>, ) -> SkipDuplicates<Store>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more