mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
rewrite the compat API to something more generic
This commit is contained in:
parent
2456a632e8
commit
116c424fba
13 changed files with 1355 additions and 132 deletions
|
@ -5,6 +5,7 @@ use time::{Duration, OffsetDateTime};
|
|||
use uuid::Uuid;
|
||||
|
||||
use super::{
|
||||
errors::ResponseError,
|
||||
meta::IndexUid,
|
||||
settings::{Settings, Unchecked},
|
||||
};
|
||||
|
@ -148,19 +149,6 @@ pub enum TaskResult {
|
|||
Other,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone, PartialEq, Eq)]
|
||||
#[cfg_attr(test, derive(serde::Serialize))]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ResponseError {
|
||||
pub message: String,
|
||||
#[serde(rename = "code")]
|
||||
pub error_code: String,
|
||||
#[serde(rename = "type")]
|
||||
pub error_type: String,
|
||||
#[serde(rename = "link")]
|
||||
pub error_link: String,
|
||||
}
|
||||
|
||||
impl Task {
|
||||
/// Return true when a task is finished.
|
||||
/// A task is finished when its last state is either `Succeeded` or `Failed`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue