pub struct RuntimeHandle { /* private fields */ }Expand description
Public, cheaply-cloneable handle. All API surfaces drive the runtime through this — no direct access to internals.
Implementations§
Source§impl RuntimeHandle
impl RuntimeHandle
Sourcepub async fn open(path: &Path) -> Result<Self>
pub async fn open(path: &Path) -> Result<Self>
Open / create the persistent store at path, then re-spawn
tick tasks for any enabled vigies recorded there.
Sourcepub async fn open_in_memory() -> Result<Self>
pub async fn open_in_memory() -> Result<Self>
In-memory store — only useful in tests + ephemeral one-shot runs.
Sourcepub async fn open_with_extensions(
path: &Path,
extensions: Vec<ExtensionHandle>,
) -> Result<Self>
pub async fn open_with_extensions( path: &Path, extensions: Vec<ExtensionHandle>, ) -> Result<Self>
Open with a custom extension bundle. mado calls this with
standard_extensions() ++ [MadoTearExtension]; tear-daemon
calls it with standard_extensions() ++ [TearCoreExtension].
Pure operators (vigy serve) take the default via [open] which
uses vigy_eval::standard_extensions() only.
Sourcepub async fn register_or_update(&self, vigy: Vigy) -> Result<Vigy>
pub async fn register_or_update(&self, vigy: Vigy) -> Result<Vigy>
Register a fresh vigy (or replace if its id matches an existing one). The new task spawns immediately; the old task (if any) is cancelled before the new one starts to guarantee no concurrent ticks.
pub async fn enable(&self, id: &VigyId) -> Result<Vigy>
pub async fn disable(&self, id: &VigyId) -> Result<Vigy>
pub async fn delete(&self, id: &VigyId) -> Result<bool>
pub async fn get(&self, id: &VigyId) -> Result<Vigy>
pub async fn list(&self, label_selector: Option<&str>) -> Result<Vec<Vigy>>
pub async fn recent_runs(&self, id: &VigyId, limit: u64) -> Result<Vec<VigyRun>>
Sourcepub async fn tick_now(&self, id: &VigyId) -> Result<VigyRun>
pub async fn tick_now(&self, id: &VigyId) -> Result<VigyRun>
Force-tick a vigy now, regardless of its schedule. Useful for
carve gate-style CI hooks + the vigy <id> tick CLI.
Sourcepub async fn tick_now_with(
&self,
id: &VigyId,
reconciler: &dyn Reconciler,
) -> Result<VigyRun>
pub async fn tick_now_with( &self, id: &VigyId, reconciler: &dyn Reconciler, ) -> Result<VigyRun>
Force-tick a vigy through a caller-supplied reconciler. Useful for tests that swap in NoopReconciler / ChainReconciler / a custom impl without changing the vigy’s stored program.
Trait Implementations§
Source§impl Clone for RuntimeHandle
impl Clone for RuntimeHandle
Source§fn clone(&self) -> RuntimeHandle
fn clone(&self) -> RuntimeHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for RuntimeHandle
impl !UnwindSafe for RuntimeHandle
impl Freeze for RuntimeHandle
impl Send for RuntimeHandle
impl Sync for RuntimeHandle
impl Unpin for RuntimeHandle
impl UnsafeUnpin for RuntimeHandle
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
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>
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>
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