pub struct CrossRefStore { /* private fields */ }Expand description
Concurrent forward/reverse index of CrossRef edges.
Implementations§
Source§impl CrossRefStore
impl CrossRefStore
Sourcepub fn insert(&self, crossref: CrossRef)
pub fn insert(&self, crossref: CrossRef)
Insert a cross-reference, indexing it in both directions.
Sourcepub fn get_forward(&self, id: &UniversalNodeId) -> Vec<CrossRef>
pub fn get_forward(&self, id: &UniversalNodeId) -> Vec<CrossRef>
All cross-refs originating from id.
Sourcepub fn get_reverse(&self, id: &UniversalNodeId) -> Vec<CrossRef>
pub fn get_reverse(&self, id: &UniversalNodeId) -> Vec<CrossRef>
All cross-refs pointing to id.
Sourcepub fn get_all(&self, id: &UniversalNodeId) -> Vec<CrossRef>
pub fn get_all(&self, id: &UniversalNodeId) -> Vec<CrossRef>
All cross-refs where id appears as source or target.
Sourcepub fn by_type(
&self,
id: &UniversalNodeId,
ref_type: &CrossRefType,
) -> Vec<CrossRef>
pub fn by_type( &self, id: &UniversalNodeId, ref_type: &CrossRefType, ) -> Vec<CrossRef>
Filter cross-refs involving id (either direction) by relationship type.
Sourcepub fn all(&self) -> Vec<CrossRef>
pub fn all(&self) -> Vec<CrossRef>
Every cross-ref in the store, each yielded exactly once.
The forward index holds one copy of each cross-ref under its source
key (the reverse index is the mirror), so flattening the forward map
enumerates the store without duplication. Ordering is unspecified
(DashMap iteration order). Intended for whole-store projections such as
the conversation.graph RPC, which scopes the result to a conversation
by intersecting each cross-ref’s endpoints against that conversation’s
node UID set (there is no conv_id on a CrossRef to filter by
directly).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CrossRefStore
impl !RefUnwindSafe for CrossRefStore
impl Send for CrossRefStore
impl Sync for CrossRefStore
impl Unpin for CrossRefStore
impl UnsafeUnpin for CrossRefStore
impl UnwindSafe for CrossRefStore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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