pub struct GraphIntrospection {
pub backend_type: String,
pub node_count: usize,
pub edge_count: EdgeCount,
pub cache_stats: CacheStats,
pub memory_usage: Option<usize>,
pub file_size: Option<u64>,
pub wal_size: Option<u64>,
pub is_in_memory: bool,
}Expand description
Comprehensive introspection data for a graph instance.
This struct provides a JSON-serializable snapshot of graph state, designed for both human debugging and LLM consumption.
§Example
ⓘ
use sqlitegraph::{open_graph, GraphConfig};
let graph = open_graph("my_graph.db", &GraphConfig::sqlite())?;
let intro = graph.introspect()?;
println!("Backend: {}", intro.backend_type);
println!("Nodes: {}", intro.node_count);
println!("Cache hit ratio: {:.2}%", intro.cache_stats.hit_ratio());
// Serialize to JSON for LLM consumption
let json = serde_json::to_string_pretty(&intro)?;Fields§
§backend_type: StringBackend type identifier (“sqlite” or “native-v2”)
node_count: usizeTotal number of nodes in the graph
edge_count: EdgeCountTotal number of edges in the graph (estimated for large graphs)
cache_stats: CacheStatsAdjacency cache statistics
memory_usage: Option<usize>Memory usage estimate in bytes (if available)
file_size: Option<u64>Database file size in bytes (for file-based backends)
wal_size: Option<u64>WAL file size in bytes (for backends with WAL enabled)
is_in_memory: boolWhether this is an in-memory database
Trait Implementations§
Source§impl Clone for GraphIntrospection
impl Clone for GraphIntrospection
Source§fn clone(&self) -> GraphIntrospection
fn clone(&self) -> GraphIntrospection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphIntrospection
impl Debug for GraphIntrospection
Auto Trait Implementations§
impl Freeze for GraphIntrospection
impl RefUnwindSafe for GraphIntrospection
impl Send for GraphIntrospection
impl Sync for GraphIntrospection
impl Unpin for GraphIntrospection
impl UnwindSafe for GraphIntrospection
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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