Struct meilisearch_sdk::progress::Progress[][src]

pub struct Progress { /* fields omitted */ }
Expand description

A struct used to track the progress of some async operations.

Implementations

let client = Client::new("http://localhost:7700", "masterKey");
let mut movies_index = client.get_or_create("movies").await.unwrap();
let progress = movies_index.delete_all_documents().await.unwrap();
let update_id = progress.get_update_id();

Example

let client = Client::new("http://localhost:7700", "masterKey");
let mut movies_index = client.get_or_create("movies").await.unwrap();
let progress = movies_index.delete_all_documents().await.unwrap();
let status = progress.get_status().await.unwrap();

Wait until MeiliSearch processes an update, 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 None will be returned.

Example

let client = Client::new("http://localhost:7700", "masterKey");
let movies = client.create_index("movies_wait_for_pending", None).await.unwrap();
 
let progress = 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();
 
let status = progress.wait_for_pending_update(None, None).await.unwrap();
 
assert!(matches!(status.unwrap(), UpdateStatus::Processed { .. }));

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 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