pub struct Runtime {
pub store: Arc<UnifiedGraphStore>,
pub watcher: Option<Watcher>,
pub indexer: IncrementalIndexer,
pub cache: QueryCache<String, String>,
pub pool: Option<ConnectionPool>,
}Expand description
Runtime combining all phase 2 components.
The Runtime manages file watching, incremental indexing,
query caching, and connection pooling for enhanced performance.
§Examples
use forgekit_core::runtime::Runtime;
use std::path::PathBuf;
let mut runtime = Runtime::new(PathBuf::from("./project")).await?;
// Start watching for file changes
let _result = runtime.start_with_watching().await?;
// Process events as they arrive
let _stats = runtime.process_events().await?;Fields§
§store: Arc<UnifiedGraphStore>The underlying graph store.
watcher: Option<Watcher>File watcher for hot-reload.
indexer: IncrementalIndexerIncremental indexer for processing changes.
cache: QueryCache<String, String>Query cache layer.
pool: Option<ConnectionPool>Connection pool (when enabled).
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub async fn start_with_watching(&mut self) -> Result<()>
pub async fn start_with_watching(&mut self) -> Result<()>
Sourcepub async fn process_events(&self) -> Result<FlushStats>
pub async fn process_events(&self) -> Result<FlushStats>
Sourcepub fn cache(&self) -> &QueryCache<String, String>
pub fn cache(&self) -> &QueryCache<String, String>
Returns a reference to the cache.
Sourcepub fn pool(&self) -> Option<&ConnectionPool>
pub fn pool(&self) -> Option<&ConnectionPool>
Returns a reference to the connection pool (if available).
Sourcepub async fn pending_changes(&self) -> usize
pub async fn pending_changes(&self) -> usize
Returns the number of pending file changes.
Sourcepub fn is_watching(&self) -> bool
pub fn is_watching(&self) -> bool
Returns true if watching is active.
Sourcepub async fn start_watching(&mut self) -> Result<()>
pub async fn start_watching(&mut self) -> Result<()>
Sourcepub fn stop_watching(&mut self)
pub fn stop_watching(&mut self)
Stops file watching.
This removes the watcher and stops receiving file system events.
Sourcepub async fn indexer_stats(&self) -> FlushStats
pub async fn indexer_stats(&self) -> FlushStats
Returns indexer statistics.
This returns pending changes count as a FlushStats-like structure.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Runtime
impl !UnwindSafe for Runtime
impl Freeze for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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