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();
pub async fn wait_for_pending_update(
&self,
interval: Option<Duration>,
timeout: Option<Duration>
) -> Option<Result<UpdateStatus, Error>>
pub async fn wait_for_pending_update(
&self,
interval: Option<Duration>,
timeout: Option<Duration>
) -> Option<Result<UpdateStatus, Error>>
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 !RefUnwindSafe for Progress
impl UnwindSafe for Progress
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
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