pub trait JobHost:
Send
+ Sync
+ Any
+ Debug {
// Required method
fn as_any(&self) -> &dyn Any;
// Provided methods
fn compact_storage(&self) -> Result<(), FnError> { ... }
fn execute_write_cypher(&self, _cypher: &str) -> Result<(), FnError> { ... }
}Expand description
Marker trait for the host’s background-job execution facilities.
Concrete hosts (e.g., uni-db’s SchedulerJobHost) implement this
and expose typed accessors on the concrete type. Job providers
downcast via JobHost::as_any when they need host services like
the storage manager, plugin registry, or write-mode inner-query
execution.
Mirrors crate::traits::procedure::ProcedureHost — same
downcasting pattern, just per-job-context flavor.
Required Methods§
Provided Methods§
Sourcefn compact_storage(&self) -> Result<(), FnError>
fn compact_storage(&self) -> Result<(), FnError>
Sourcefn execute_write_cypher(&self, _cypher: &str) -> Result<(), FnError>
fn execute_write_cypher(&self, _cypher: &str) -> Result<(), FnError>
Execute a write-mode Cypher statement against the host.
The built-in uni.system.ttl_sweep job calls this with a
MATCH (n) WHERE n.__ttl < timestamp() DETACH DELETE n body.
The default impl returns an error so test hosts that don’t
wire write-mode Cypher can still load.
§Errors
Returns FnError if the host has not wired write-mode
Cypher (default) or if the statement fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".