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

pub struct Progress<'a> { /* fields omitted */ }

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

Implementations

impl<'a> Progress<'a>[src]

pub async fn get_status(&self) -> Result<UpdateStatus, Error>[src]

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();

pub async fn wait_for_pending_update(
    &self,
    interval: Option<Duration>,
    timeout: Option<Duration>
) -> Option<Result<UpdateStatus, Error>>
[src]

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

impl<'a> RefUnwindSafe for Progress<'a>

impl<'a> Send for Progress<'a>

impl<'a> Sync for Progress<'a>

impl<'a> Unpin for Progress<'a>

impl<'a> UnwindSafe for Progress<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithSubscriber for T[src]