pub struct ForgeRuntime { /* private fields */ }Expand description
ForgeKit runtime for automatic reindexing and caching.
The ForgeRuntime integrates file watching, incremental indexing,
query caching, and metrics collection into a single API.
Implementations§
Source§impl ForgeRuntime
impl ForgeRuntime
Sourcepub async fn with_config(
codebase_path: impl AsRef<Path>,
config: RuntimeConfig,
) -> Result<Self>
pub async fn with_config( codebase_path: impl AsRef<Path>, config: RuntimeConfig, ) -> Result<Self>
Creates a new runtime with custom configuration.
§Arguments
codebase_path- Path to codebaseconfig- Runtime configuration
Sourcepub async fn watch(&mut self) -> Result<()>
pub async fn watch(&mut self) -> Result<()>
Starts the file watcher for automatic reindexing.
This will monitor the codebase for changes and trigger reindexing as needed. Events are debounced to avoid excessive reindexing.
Sourcepub async fn stop_watching(&mut self) -> Result<()>
pub async fn stop_watching(&mut self) -> Result<()>
Stops the file watcher.
Sourcepub fn cache(&self) -> Option<&QueryCache<String, String>>
pub fn cache(&self) -> Option<&QueryCache<String, String>>
Gets a reference to the query cache.
Sourcepub fn metrics(&self) -> &RuntimeMetrics
pub fn metrics(&self) -> &RuntimeMetrics
Gets a reference to the metrics collector.
Sourcepub async fn clear_cache(&self) -> Result<()>
pub async fn clear_cache(&self) -> Result<()>
Clears all caches.
Sourcepub fn stats(&self) -> RuntimeStats
pub fn stats(&self) -> RuntimeStats
Gets runtime statistics.
Sourcepub fn codebase_path(&self) -> &Path
pub fn codebase_path(&self) -> &Path
Gets the codebase path.
Sourcepub fn config(&self) -> &RuntimeConfig
pub fn config(&self) -> &RuntimeConfig
Gets the configuration.
Trait Implementations§
Source§impl Drop for ForgeRuntime
impl Drop for ForgeRuntime
Auto Trait Implementations§
impl !RefUnwindSafe for ForgeRuntime
impl !UnwindSafe for ForgeRuntime
impl Freeze for ForgeRuntime
impl Send for ForgeRuntime
impl Sync for ForgeRuntime
impl Unpin for ForgeRuntime
impl UnsafeUnpin for ForgeRuntime
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> 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