Skip to content

Commit ade55ed

Browse files
committed
rust: Add Svix::background_task
Make listing and reading background tasks available in the API.
1 parent 598593e commit ade55ed

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rust/src/api.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ impl Svix {
7575
Application::new(&self.cfg)
7676
}
7777

78+
pub fn background_task(&self) -> BackgroundTask<'_> {
79+
BackgroundTask::new(&self.cfg)
80+
}
81+
7882
pub fn endpoint(&self) -> Endpoint<'_> {
7983
Endpoint::new(&self.cfg)
8084
}
@@ -1222,6 +1226,10 @@ pub struct BackgroundTask<'a> {
12221226
}
12231227

12241228
impl<'a> BackgroundTask<'a> {
1229+
fn new(cfg: &'a Configuration) -> Self {
1230+
Self { cfg }
1231+
}
1232+
12251233
pub async fn list(
12261234
&self,
12271235
options: Option<BackgroundTaskListOptions>,

0 commit comments

Comments
 (0)