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>
Sourcepub fn register_request(
&self,
payload: &AutoRegisterRequest,
) -> Result<AutoRegisterRequestResponse>
pub fn register_request( &self, payload: &AutoRegisterRequest, ) -> Result<AutoRegisterRequestResponse>
Create a Pending Workers row. Unauthenticated on purpose — the studio rate-limits this endpoint by source IP and the operator manually approves before the worker can do anything.
Sourcepub fn poll_register_status(
&self,
request_id: &str,
registration_secret: &str,
) -> Result<Option<RegisterStatus>>
pub fn poll_register_status( &self, request_id: &str, registration_secret: &str, ) -> Result<Option<RegisterStatus>>
Poll the studio for the operator’s decision on a previously
submitted register-request. Returns Ok(None) when the
request id is unknown to the studio (likely cleaned up or
never existed) so the orchestrator can drop the stale id and
start a fresh one. Auth is the raw registration_secret
presented as a Bearer token.
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).
This is the only worker-side HTTP route that survives the WS
migration: R2 multipart doesn’t fit cleanly into WS frames.
Heartbeats, claim/accept/reject, completeJson, fail, and log
shipping all flow over the WS session owned by
ws::session::spawn_ws_session.
Auto Trait Implementations§
impl !RefUnwindSafe for ApiClient
impl !UnwindSafe for ApiClient
impl Freeze for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.