pub struct GraphTableIndex { /* private fields */ }Expand description
Bidirectional index for graph-table linkage
Enables efficient lookups in both directions:
- From graph node to table row
- From table row to graph node
Thread-safe with sharded locking for concurrent access.
Implementations§
Source§impl GraphTableIndex
impl GraphTableIndex
Sourcepub fn link(&self, node_id: &str, table_id: u16, row_id: u64)
pub fn link(&self, node_id: &str, table_id: u16, row_id: u64)
Link a graph node to a table row
Creates bidirectional mapping between node_id and (table_id, row_id). Overwrites existing mappings if present.
Sourcepub fn unlink_node(&self, node_id: &str) -> Option<TableRef>
pub fn unlink_node(&self, node_id: &str) -> Option<TableRef>
Unlink a graph node from its table row
Removes both directions of the mapping. Returns the TableRef if it existed.
Sourcepub fn unlink_row(&self, table_id: u16, row_id: u64) -> Option<String>
pub fn unlink_row(&self, table_id: u16, row_id: u64) -> Option<String>
Unlink a table row from its graph node
Removes both directions of the mapping. Returns the node_id if it existed.
Sourcepub fn get_row_for_node(&self, node_id: &str) -> Option<TableRef>
pub fn get_row_for_node(&self, node_id: &str) -> Option<TableRef>
Get the table row for a graph node
Sourcepub fn get_node_for_row(&self, table_id: u16, row_id: u64) -> Option<String>
pub fn get_node_for_row(&self, table_id: u16, row_id: u64) -> Option<String>
Get the graph node for a table row
Sourcepub fn is_node_linked(&self, node_id: &str) -> bool
pub fn is_node_linked(&self, node_id: &str) -> bool
Check if a node is linked to a table row
Sourcepub fn is_row_linked(&self, table_id: u16, row_id: u64) -> bool
pub fn is_row_linked(&self, table_id: u16, row_id: u64) -> bool
Check if a table row is linked to a graph node
Sourcepub fn nodes_for_table(&self, table_id: u16) -> Vec<(u64, String)>
pub fn nodes_for_table(&self, table_id: u16) -> Vec<(u64, String)>
Get all nodes linked to a specific table
Returns pairs of (row_id, node_id) for the given table.
Sourcepub fn stats(&self) -> GraphTableIndexStats
pub fn stats(&self) -> GraphTableIndexStats
Get statistics about the index
Sourcepub fn deserialize(data: &[u8]) -> Result<Self, GraphTableIndexError>
pub fn deserialize(data: &[u8]) -> Result<Self, GraphTableIndexError>
Deserialize from bytes
Trait Implementations§
Auto Trait Implementations§
impl Forget for GraphTableIndex
impl Freeze for GraphTableIndex
impl Move for GraphTableIndex
impl RefUnwindSafe for GraphTableIndexwhere
RwLock<HashMap<String, TableRef>>: RefUnwindSafe,
RwLock<HashMap<RowKey, String>>: RefUnwindSafe,
impl Send for GraphTableIndex
impl Sync for GraphTableIndex
impl Unpin for GraphTableIndex
impl UnsafeUnpin for GraphTableIndexwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<RwLock<HashMap<String, TableRef>>>: UnsafeUnpin,
PhantomData<RwLock<HashMap<RowKey, String>>>: UnsafeUnpin,
impl UnwindSafe for GraphTableIndexwhere
RawVecInner: UnwindSafe,
RwLock<HashMap<String, TableRef>>: UnwindSafe,
RwLock<HashMap<RowKey, String>>: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request