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]
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]
&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<'a> RefUnwindSafe for Progress<'a>
impl<'a> RefUnwindSafe for Progress<'a>impl<'a> UnwindSafe for Progress<'a>
impl<'a> UnwindSafe for Progress<'a>Blanket Implementations
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> WithSubscriber for T[src]
impl<T> WithSubscriber for T[src]pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>, [src]
S: Into<Dispatch>,