pub struct SimulationAPI { /* private fields */ }Expand description
Simulation-as-a-Service API
Implementations§
Source§impl SimulationAPI
impl SimulationAPI
Sourcepub fn with_storage(path: impl Into<PathBuf>) -> Self
pub fn with_storage(path: impl Into<PathBuf>) -> Self
Create API with persistent storage
Sourcepub fn submit_job(&self, job: SimulationJob) -> Uuid
pub fn submit_job(&self, job: SimulationJob) -> Uuid
Submit a simulation job
Sourcepub fn get_next_job(&self) -> Option<SimulationJob>
pub fn get_next_job(&self) -> Option<SimulationJob>
Get next job from queue
Sourcepub fn get_job(&self, id: &Uuid) -> Option<SimulationJob>
pub fn get_job(&self, id: &Uuid) -> Option<SimulationJob>
Get job status
Sourcepub fn cancel_job(&self, id: &Uuid) -> bool
pub fn cancel_job(&self, id: &Uuid) -> bool
Cancel a job
Sourcepub fn complete_job(
&self,
job_id: Uuid,
metrics: SimulationMetrics,
) -> SimResult<Uuid>
pub fn complete_job( &self, job_id: Uuid, metrics: SimulationMetrics, ) -> SimResult<Uuid>
Complete a job and store result
Sourcepub fn get_result(&self, id: &Uuid) -> Option<SimulationResult>
pub fn get_result(&self, id: &Uuid) -> Option<SimulationResult>
Get simulation result
Sourcepub fn get_job_results(&self, job_id: &Uuid) -> Vec<SimulationResult>
pub fn get_job_results(&self, job_id: &Uuid) -> Vec<SimulationResult>
Get all results for a job
Sourcepub fn compare_results(&self, result_ids: Vec<Uuid>) -> SimResult<Uuid>
pub fn compare_results(&self, result_ids: Vec<Uuid>) -> SimResult<Uuid>
Compare simulation results
Sourcepub fn get_comparison(&self, id: &Uuid) -> Option<SimulationComparison>
pub fn get_comparison(&self, id: &Uuid) -> Option<SimulationComparison>
Get comparison
Sourcepub fn get_next_webhook(&self) -> Option<(String, WebhookNotification)>
pub fn get_next_webhook(&self) -> Option<(String, WebhookNotification)>
Get next pending webhook
Sourcepub fn mark_webhook_delivered(
&self,
url: String,
notification: WebhookNotification,
)
pub fn mark_webhook_delivered( &self, url: String, notification: WebhookNotification, )
Mark webhook as delivered
Sourcepub fn get_queue_stats(&self) -> QueueStats
pub fn get_queue_stats(&self) -> QueueStats
Get queue statistics
Trait Implementations§
Source§impl Debug for SimulationAPI
impl Debug for SimulationAPI
Auto Trait Implementations§
impl Freeze for SimulationAPI
impl RefUnwindSafe for SimulationAPI
impl Send for SimulationAPI
impl Sync for SimulationAPI
impl Unpin for SimulationAPI
impl UnwindSafe for SimulationAPI
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