Skip to content

Commit 40184eb

Browse files
authored
rust: Add Svix::background_task (#1341)
## Motivation We previously had the `BackgroundTask` object as a proxy object for the two background task routes, but no way to construct and thus use it. ## Solution Add a method to `Svix` like we have for all the other proxy objects. Closes #1340.
2 parents 598593e + ade55ed commit 40184eb

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)