pub struct ScriptingClient { /* private fields */ }Implementations§
Source§impl ScriptingClient
impl ScriptingClient
Sourcepub fn with_poll_schedule(self, poll: PollSchedule) -> ScriptingClient
pub fn with_poll_schedule(self, poll: PollSchedule) -> ScriptingClient
Override how Self::execute polls for a terminal status.
Sourcepub async fn create_execution(&self, body: &Value) -> Result<Value, SdkError>
pub async fn create_execution(&self, body: &Value) -> Result<Value, SdkError>
POST /scripting/executions — submit a program; returns the 202 job.
Sourcepub async fn get_execution(&self, id: &str) -> Result<Value, SdkError>
pub async fn get_execution(&self, id: &str) -> Result<Value, SdkError>
GET /scripting/executions/{id} — the only route that carries result.
Sourcepub async fn list_executions(
&self,
limit: Option<i64>,
) -> Result<Value, SdkError>
pub async fn list_executions( &self, limit: Option<i64>, ) -> Result<Value, SdkError>
GET /scripting/executions?limit=… — summaries (no result), newest first.
Sourcepub async fn cancel_execution(&self, id: &str) -> Result<(), SdkError>
pub async fn cancel_execution(&self, id: &str) -> Result<(), SdkError>
DELETE /scripting/executions/{id} — request cooperative cancellation.
Cancellation is not a rollback: effects the program already applied stay applied, and the worker only notices within a few seconds.
Sourcepub async fn execute(&self, body: &Value) -> Result<Value, SdkError>
pub async fn execute(&self, body: &Value) -> Result<Value, SdkError>
Submit a program and wait for it to finish, returning its result.
Polls Self::get_execution every initial_delay, doubling up to
max_delay, until the job is terminal or timeout elapses — see
PollSchedule. A script fault is not an HTTP error: the submission
still succeeds and the failure lands in the job, so failed / canceled
are surfaced here as SdkError::Other carrying the job’s error text.
Trait Implementations§
Source§impl Clone for ScriptingClient
impl Clone for ScriptingClient
Source§fn clone(&self) -> ScriptingClient
fn clone(&self) -> ScriptingClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more