pub struct DmsClient { /* private fields */ }Expand description
Minimal DMS HTTP client using rustls with sensitive Authorization header.
Implementations§
Source§impl DmsClient
impl DmsClient
Sourcepub fn new(base: Url, timeout: Duration, bearer: Option<String>) -> Result<Self>
pub fn new(base: Url, timeout: Duration, bearer: Option<String>) -> Result<Self>
Create client with base URL, timeout, and optional bearer token.
Sourcepub async fn lease_by_capability(
&self,
_capability: &str,
) -> Result<Option<LeaseResponse>>
pub async fn lease_by_capability( &self, _capability: &str, ) -> Result<Option<LeaseResponse>>
Lease a task: GET /tasks
capability is accepted for optional filter but not implemented yet.
Sourcepub async fn complete(
&self,
task_id: Uuid,
body: &CompleteTaskRequest,
) -> Result<()>
pub async fn complete( &self, task_id: Uuid, body: &CompleteTaskRequest, ) -> Result<()>
Complete task: POST /tasks/{id}/complete
Sourcepub async fn fail(&self, task_id: Uuid, body: &FailTaskRequest) -> Result<()>
pub async fn fail(&self, task_id: Uuid, body: &FailTaskRequest) -> Result<()>
Fail task: POST /tasks/{id}/fail
Sourcepub async fn heartbeat(
&self,
task_id: Uuid,
body: &HeartbeatRequest,
) -> Result<HeartbeatResponse>
pub async fn heartbeat( &self, task_id: Uuid, body: &HeartbeatRequest, ) -> Result<HeartbeatResponse>
Heartbeat: POST /tasks/{id}/heartbeat with progress payload. Returns potential new access token for storage.
Trait Implementations§
Source§impl HeartbeatTransport for DmsClient
impl HeartbeatTransport for DmsClient
fn post_heartbeat<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: Uuid,
body: &'life1 HeartbeatRequest,
) -> Pin<Box<dyn Future<Output = Result<HeartbeatResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for DmsClient
impl !RefUnwindSafe for DmsClient
impl Send for DmsClient
impl Sync for DmsClient
impl Unpin for DmsClient
impl !UnwindSafe for DmsClient
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