pub struct CrossRefStore { /* private fields */ }Expand description
SQLite-backed storage for cross-partition edges
The store persists the CrossRefIndex to disk and loads it fully
on startup. This is efficient because cross-partition edges are
typically a small fraction of total edges.
Implementations§
Source§impl CrossRefStore
impl CrossRefStore
Sourcepub fn open(path: &Path) -> Result<Self, CrossRefError>
pub fn open(path: &Path) -> Result<Self, CrossRefError>
Open an existing cross_refs.db
Sourcepub fn create(path: &Path) -> Result<Self, CrossRefError>
pub fn create(path: &Path) -> Result<Self, CrossRefError>
Create a new cross_refs.db with schema
Sourcepub fn in_memory() -> Result<Self, CrossRefError>
pub fn in_memory() -> Result<Self, CrossRefError>
Create an in-memory cross_refs database (for testing)
Sourcepub fn load_all(&self) -> Result<CrossRefIndex, CrossRefError>
pub fn load_all(&self) -> Result<CrossRefIndex, CrossRefError>
Load all cross-references into a CrossRefIndex
Sourcepub fn save_all(&self, index: &CrossRefIndex) -> Result<(), CrossRefError>
pub fn save_all(&self, index: &CrossRefIndex) -> Result<(), CrossRefError>
Save a CrossRefIndex to the database (replaces all existing data)
Sourcepub fn add_refs(&self, refs: &[CrossRef]) -> Result<(), CrossRefError>
pub fn add_refs(&self, refs: &[CrossRef]) -> Result<(), CrossRefError>
Add cross-references (appends to existing data)
Sourcepub fn remove_refs_by_partition(
&self,
partition: &str,
) -> Result<usize, CrossRefError>
pub fn remove_refs_by_partition( &self, partition: &str, ) -> Result<usize, CrossRefError>
Remove all cross-references involving a specific partition
Sourcepub fn remove_refs_by_source_partition(
&self,
partition: &str,
) -> Result<usize, CrossRefError>
pub fn remove_refs_by_source_partition( &self, partition: &str, ) -> Result<usize, CrossRefError>
Remove cross-references where source is from a specific partition
Sourcepub fn count(&self) -> Result<usize, CrossRefError>
pub fn count(&self) -> Result<usize, CrossRefError>
Get count of cross-references
Auto Trait Implementations§
impl !Freeze for CrossRefStore
impl !RefUnwindSafe for CrossRefStore
impl Send for CrossRefStore
impl !Sync for CrossRefStore
impl Unpin 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
Mutably borrows from an owned value. Read more
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>
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