Skip to main content

StorageBackend

Enum StorageBackend 

Source
pub enum StorageBackend {
    RocksDB(RealRocksDBStorage),
    SurrealDB(Arc<SurrealDBStorage>),
}
Expand description

Unified storage backend enum for runtime selection.

This enum wraps the different storage implementations and provides a unified interface for the rest of the application.

Variants§

§

RocksDB(RealRocksDBStorage)

RocksDB-based local storage (default)

§

SurrealDB(Arc<SurrealDBStorage>)

SurrealDB-based storage with native graph support

Implementations§

Source§

impl StorageBackend

Source

pub fn supports_native_graph(&self) -> bool

Check if this backend supports native graph operations

Source

pub fn supports_native_vectors(&self) -> bool

Check if this backend supports native vector operations

Trait Implementations§

Source§

impl Clone for StorageBackend

Source§

fn clone(&self) -> StorageBackend

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl FreshnessStorage for StorageBackend

Source§

fn register_source<'life0, 'async_trait>( &'life0 self, session_id: Uuid, reference: SourceReference, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Register or update a source reference for an entry
Source§

fn check_freshness<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, entry_id: &'life1 str, file_hash: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<FreshnessEntry>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Check if an entry’s stored hash matches the provided hash. When the stored entry has a FunctionScope with ast_hash, compares that instead of the file-level hash (semantic freshness).
Source§

fn invalidate_source<'life0, 'life1, 'async_trait>( &'life0 self, file_path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Invalidate (remove) a source reference, usually because the source changed or the entry is being deleted. Returns count of removed references.
Source§

fn get_entries_by_source<'life0, 'life1, 'async_trait>( &'life0 self, file_path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SourceReference>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all entries associated with a specific file path
Source§

fn get_stale_entries_by_source<'life0, 'life1, 'async_trait>( &'life0 self, file_path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<StaleEntryInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return entry_ids (plus symbol metadata) for all source_reference records that are still marked stale (status=1) for the given file. Called by Axon after register_source_batch to detect symbols that were deleted from the file (they were marked stale by invalidate_source but never re-registered).
Source§

fn check_freshness_semantic<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, entry_id: &'life1 str, file_hash: &'life2 [u8], ast_hash: Option<&'life3 [u8]>, symbol_name: Option<&'life4 str>, ) -> Pin<Box<dyn Future<Output = Result<FreshnessEntry>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Semantic freshness check: compare ast_hash when available, fallback to file hash. The ast_hash and symbol_name are optional — if provided and the stored entry has a FunctionScope, ast_hash comparison is used instead of file-level hash.
Source§

fn register_symbol_dependencies<'life0, 'async_trait>( &'life0 self, from: SymbolId, to_symbols: Vec<SymbolId>, ) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Register symbol-level dependencies (e.g., fn foo depends on struct Bar). Used for cascade invalidation.
Source§

fn cascade_invalidate<'life0, 'async_trait>( &'life0 self, changed: SymbolId, new_ast_hash: Vec<u8>, max_depth: u32, ) -> Pin<Box<dyn Future<Output = Result<CascadeInvalidateReport>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cascade invalidate: when a symbol changes, invalidate all entries whose symbols depend on it (transitively up to max_depth).
Source§

fn check_freshness_batch<'life0, 'async_trait>( &'life0 self, entries: Vec<(String, Vec<u8>, Option<Vec<u8>>, Option<String>)>, ) -> Pin<Box<dyn Future<Output = Result<Vec<FreshnessEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Batch freshness check: check multiple entries in a single storage round-trip. Read more
Source§

impl GraphStorage for StorageBackend

Source§

fn upsert_entity<'life0, 'life1, 'async_trait>( &'life0 self, session_id: Uuid, entity: &'life1 EntityData, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Insert or update an entity
Source§

fn get_entity<'life0, 'life1, 'async_trait>( &'life0 self, session_id: Uuid, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<EntityData>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get an entity by name
Source§

fn list_entities<'life0, 'async_trait>( &'life0 self, session_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<EntityData>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all entities for a session
Source§

fn delete_entity<'life0, 'life1, 'async_trait>( &'life0 self, session_id: Uuid, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete an entity
Source§

fn create_relationship<'life0, 'life1, 'async_trait>( &'life0 self, session_id: Uuid, relationship: &'life1 EntityRelationship, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a relationship between entities
Find all entities related to a given entity
Find entities related by a specific relation type
Source§

fn find_shortest_path<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: Uuid, from: &'life1 str, to: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Find the shortest path between two entities
Source§

fn get_entity_network<'life0, 'life1, 'async_trait>( &'life0 self, session_id: Uuid, center: &'life1 str, max_depth: usize, ) -> Pin<Box<dyn Future<Output = Result<EntityNetwork>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the entity network (subgraph) around a center entity
Source§

impl Storage for StorageBackend

Source§

fn save_session<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 ActiveSession, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a session to storage
Source§

fn load_session<'life0, 'async_trait>( &'life0 self, session_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<ActiveSession>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load a session from storage
Source§

fn delete_session<'life0, 'async_trait>( &'life0 self, session_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete a session and all related data
Source§

fn clear_session_entities<'life0, 'async_trait>( &'life0 self, session_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete all entities and relationships for a session (used by entity graph rebuild)
Source§

fn list_sessions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all session IDs
Source§

fn session_exists<'life0, 'async_trait>( &'life0 self, session_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if a session exists
Source§

fn batch_save_updates<'life0, 'async_trait>( &'life0 self, session_id: Uuid, updates: Vec<ContextUpdate>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Batch save multiple context updates efficiently
Source§

fn save_session_with_updates<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 ActiveSession, session_id: Uuid, updates: Vec<ContextUpdate>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save session and context updates in a single atomic write. Default implementation calls save_session then batch_save_updates sequentially. Backends can override for a single WriteBatch operation.
Source§

fn load_session_updates<'life0, 'async_trait>( &'life0 self, session_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<ContextUpdate>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load all updates for a session
Source§

fn save_checkpoint<'life0, 'life1, 'async_trait>( &'life0 self, checkpoint: &'life1 SessionCheckpoint, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a session checkpoint
Source§

fn load_checkpoint<'life0, 'async_trait>( &'life0 self, checkpoint_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<SessionCheckpoint>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load a session checkpoint
Source§

fn list_checkpoints<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<SessionCheckpoint>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all checkpoints
Source§

fn save_workspace_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, workspace_id: Uuid, name: &'life1 str, description: &'life2 str, session_ids: &'life3 [Uuid], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Save workspace metadata
Source§

fn delete_workspace<'life0, 'async_trait>( &'life0 self, workspace_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete a workspace
Source§

fn list_workspaces<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<StoredWorkspace>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all workspaces
Source§

fn add_session_to_workspace<'life0, 'async_trait>( &'life0 self, workspace_id: Uuid, session_id: Uuid, role: SessionRole, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add a session to a workspace
Source§

fn remove_session_from_workspace<'life0, 'async_trait>( &'life0 self, workspace_id: Uuid, session_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove a session from a workspace
Source§

fn compact<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Force database compaction
Source§

fn get_key_count<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get estimated number of keys in database
Source§

fn get_stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get database statistics as a string

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool

Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool