pub struct ApiClient {
pub base_url: String,
pub client: Client,
}Fields§
§base_url: String§client: ClientImplementations§
Source§impl ApiClient
impl ApiClient
pub fn new(base_url: String) -> Result<Self>
pub fn register( &self, bootstrap_token: &str, cap: WorkerCapabilities, worker_id: Option<String>, ) -> Result<RegisterResponse>
pub fn heartbeat( &self, worker_id: &str, token: &str, cap: WorkerCapabilities, current_job_id: Option<String>, ) -> Result<()>
Sourcepub fn claim(&self, worker_id: &str, token: &str) -> Result<Option<JobClaim>>
pub fn claim(&self, worker_id: &str, token: &str) -> Result<Option<JobClaim>>
Returns Ok(None) on HTTP 204 (no jobs).
Sourcepub fn complete(
&self,
worker_id: &str,
token: &str,
job_id: &str,
ext: &str,
prompt: &str,
image: Vec<u8>,
) -> Result<()>
pub fn complete( &self, worker_id: &str, token: &str, job_id: &str, ext: &str, prompt: &str, image: Vec<u8>, ) -> Result<()>
Complete a job with binary output (image / audio / video).
Sourcepub fn complete_json(
&self,
worker_id: &str,
token: &str,
job_id: &str,
prompt: &str,
result: &Value,
) -> Result<()>
pub fn complete_json( &self, worker_id: &str, token: &str, job_id: &str, prompt: &str, result: &Value, ) -> Result<()>
Complete a job with structured JSON output (LLM / STT).
pub fn fail( &self, worker_id: &str, token: &str, job_id: &str, error: &str, retryable: bool, ) -> Result<()>
pub fn ship_logs( &self, worker_id: &str, token: &str, batch: LogBatch, ) -> Result<()>
Auto Trait Implementations§
impl Freeze for ApiClient
impl !RefUnwindSafe for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl UnsafeUnpin for ApiClient
impl !UnwindSafe for ApiClient
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