pub enum Task {
    Enqueued {
        content: EnqueuedTask,
    },
    Processing {
        content: EnqueuedTask,
    },
    Failed {
        content: FailedTask,
    },
    Succeeded {
        content: ProcessedTask,
    },
}

Variants

Enqueued

Fields

content: EnqueuedTask

Processing

Fields

content: EnqueuedTask

Failed

Fields

content: FailedTask

Succeeded

Fields

content: ProcessedTask

Implementations

Wait until Meilisearch processes a Task, and get its status.

interval = The frequency at which the server should be polled. Default = 50ms timeout = The maximum time to wait for processing to complete. Default = 5000ms

If the waited time exceeds timeout then an Error::Timeout will be returned.

See also [Client::wait_for_task, Index::wait_for_task].

Example
let client = Client::new("http://localhost:7700", "masterKey");
let movies = client.index("movies_wait_for_completion");

let status = movies.add_documents(&[
    Document { id: 0, kind: "title".into(), value: "The Social Network".to_string() },
    Document { id: 1, kind: "title".into(), value: "Harry Potter and the Sorcerer's Stone".to_string() },
], None)
  .await
  .unwrap()
  .wait_for_completion(&client, None, None)
  .await
  .unwrap();

assert!(matches!(status, Task::Succeeded { .. }));

Extract the Index from a successful IndexCreation task.

If the task failed or was not an IndexCreation task it return itself.

Example
// create the client
let client = Client::new("http://localhost:7700", "masterKey");

// create a new index called movies
let task = client.create_index("try_make_index", None).await.unwrap();
let index = client.wait_for_task(task, None, None).await.unwrap().try_make_index(&client).unwrap();

// and safely access it
assert_eq!(index.as_ref(), "try_make_index");

Trait Implementations

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more