Skip to content

Commit 4e998c7

Browse files
committed
Merge
2 parents d90926f + a17b669 commit 4e998c7

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

src/client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,6 @@ impl Client {
860860
/// let tasks = client.get_tasks().await.unwrap();
861861
///
862862
/// # assert!(tasks.results.len() > 0);
863-
/// # client.index("get_tasks").delete().await.unwrap().wait_for_completion(&client, None, None).await.unwrap();
864863
/// # });
865864
/// ```
866865
pub async fn get_tasks(&self) -> Result<TasksResults, Error> {

src/errors.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ pub enum ErrorCode {
139139
MissingAuthorizationHeader,
140140
TaskNotFound,
141141
DumpNotFound,
142+
MssingMasterKey,
142143
NoSpaceLeftOnDevice,
143144
PayloadTooLarge,
144145
UnretrievableDocument,

src/tasks.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ pub enum TaskType {
3838
TaskDeletion {
3939
details: Option<TaskDeletion>,
4040
},
41+
SnapshotCreation {
42+
details: Option<SnapshotCreation>,
43+
},
4144
}
4245

4346
#[derive(Debug, Clone, Deserialize)]
@@ -79,6 +82,10 @@ pub struct IndexDeletion {
7982
pub deleted_documents: Option<usize>,
8083
}
8184

85+
#[derive(Debug, Clone, Deserialize)]
86+
#[serde(rename_all = "camelCase")]
87+
pub struct SnapshotCreation {}
88+
8289
#[derive(Debug, Clone, Deserialize)]
8390
#[serde(rename_all = "camelCase")]
8491
pub struct DumpCreation {
@@ -135,6 +142,7 @@ pub struct SucceededTask {
135142
pub started_at: OffsetDateTime,
136143
#[serde(with = "time::serde::rfc3339")]
137144
pub finished_at: OffsetDateTime,
145+
pub canceled_by: Option<usize>,
138146
pub index_uid: Option<String>,
139147
#[serde(flatten)]
140148
pub update_type: TaskType,
@@ -271,6 +279,7 @@ impl Task {
271279
/// # index.delete().await.unwrap().wait_for_completion(&client, None, None).await.unwrap();
272280
/// # });
273281
/// ```
282+
#[allow(clippy::result_large_err)] // Since `self` has been consumed, this is not an issue
274283
pub fn try_make_index(self, client: &Client) -> Result<Index, Self> {
275284
match self {
276285
Self::Succeeded {
@@ -504,30 +513,30 @@ pub struct TasksQuery<'a, T> {
504513
impl<'a, T> TasksQuery<'a, T> {
505514
pub fn with_index_uids<'b>(
506515
&'b mut self,
507-
index_uid: impl IntoIterator<Item = &'a str>,
516+
index_uids: impl IntoIterator<Item = &'a str>,
508517
) -> &'b mut TasksQuery<'a, T> {
509-
self.index_uids = Some(index_uid.into_iter().collect());
518+
self.index_uids = Some(index_uids.into_iter().collect());
510519
self
511520
}
512521
pub fn with_statuses<'b>(
513522
&'b mut self,
514-
status: impl IntoIterator<Item = &'a str>,
523+
statuses: impl IntoIterator<Item = &'a str>,
515524
) -> &'b mut TasksQuery<'a, T> {
516-
self.statuses = Some(status.into_iter().collect());
525+
self.statuses = Some(statuses.into_iter().collect());
517526
self
518527
}
519528
pub fn with_types<'b>(
520529
&'b mut self,
521-
task_type: impl IntoIterator<Item = &'a str>,
530+
task_types: impl IntoIterator<Item = &'a str>,
522531
) -> &'b mut TasksQuery<'a, T> {
523-
self.task_types = Some(task_type.into_iter().collect());
532+
self.task_types = Some(task_types.into_iter().collect());
524533
self
525534
}
526535
pub fn with_uids<'b>(
527536
&'b mut self,
528-
index_uid: impl IntoIterator<Item = &'a u32>,
537+
uids: impl IntoIterator<Item = &'a u32>,
529538
) -> &'b mut TasksQuery<'a, T> {
530-
self.uids = Some(index_uid.into_iter().collect());
539+
self.uids = Some(uids.into_iter().collect());
531540
self
532541
}
533542
pub fn with_before_enqueued_at<'b>(

0 commit comments

Comments
 (0)