Trait OniroRuntime
pub trait OniroRuntime: Send + Sync {
// Required methods
fn train(&self, request: TrainRequest) -> Result<RunHandle>;
fn metric(&self, request: MetricRequest) -> Result<f64>;
// Provided method
fn validate_resume(&self, _run: &RunHandle) -> Result<()> { ... }
}Expand description
Runs and measures Oniro work through a typed, object-safe interface.
Required Methods§
fn train(&self, request: TrainRequest) -> Result<RunHandle>
fn train(&self, request: TrainRequest) -> Result<RunHandle>
Trains from a materialized configuration and returns an opaque run handle.
§Errors
Returns SpikeError::Io for process or filesystem failures,
SpikeError::Oniro for a failed operation or invalid runtime output,
SpikeError::ResourceCap for an invalid bounded request, or
SpikeError::Timeout when a configured timeout expires.
fn metric(&self, request: MetricRequest) -> Result<f64>
fn metric(&self, request: MetricRequest) -> Result<f64>
Measures a completed run using the requested metric source.
§Errors
Returns SpikeError::Io for process or filesystem failures,
SpikeError::Oniro when the requested metric cannot be produced,
SpikeError::ResourceCap for an invalid bounded request, or
SpikeError::Timeout when a configured timeout expires.
Provided Methods§
fn validate_resume(&self, _run: &RunHandle) -> Result<()>
fn validate_resume(&self, _run: &RunHandle) -> Result<()>
Validates a resume handle before a caller materializes a new config.
Runtime implementations that use opaque non-filesystem references may accept the default no-op. Filesystem-backed implementations must reject a missing, escaped, or otherwise invalid checkpoint here, before the caller publishes an invocation-owned artifact.
§Errors
Returns SpikeError::Io or SpikeError::Oniro when the handle is
not a usable resume checkpoint.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".