redis_cloud/handlers/tasks.rs
1//! Task operations handler
2
3use crate::{Result, client::CloudClient};
4use serde_json::Value;
5
6/// Handler for Cloud task operations
7pub struct CloudTasksHandler {
8 client: CloudClient,
9}
10
11impl CloudTasksHandler {
12 pub fn new(client: CloudClient) -> Self {
13 CloudTasksHandler { client }
14 }
15
16 /// List all tasks
17 pub async fn list(&self) -> Result<Value> {
18 self.client.get("/tasks").await
19 }
20
21 /// Get task by ID
22 pub async fn get(&self, task_id: &str) -> Result<Value> {
23 self.client.get(&format!("/tasks/{}", task_id)).await
24 }
25}