pub struct TaskInfo {
pub enqueued_at: OffsetDateTime,
pub index_uid: Option<String>,
pub status: String,
pub update_type: TaskType,
pub task_uid: u32,
}Fields§
§enqueued_at: OffsetDateTime§index_uid: Option<String>§status: String§update_type: TaskType§task_uid: u32Implementations§
Source§impl TaskInfo
impl TaskInfo
pub fn get_task_uid(&self) -> u32
Sourcepub async fn wait_for_completion<Http: HttpClient>(
self,
client: &Client<Http>,
interval: Option<Duration>,
timeout: Option<Duration>,
) -> Result<Task, Error>
pub async fn wait_for_completion<Http: HttpClient>( self, client: &Client<Http>, interval: Option<Duration>, timeout: Option<Duration>, ) -> Result<Task, Error>
Wait until Meilisearch processes a task provided by TaskInfo, 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 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 { .. }));Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskInfo
impl<'de> Deserialize<'de> for TaskInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TaskInfo
impl RefUnwindSafe for TaskInfo
impl Send for TaskInfo
impl Sync for TaskInfo
impl Unpin for TaskInfo
impl UnwindSafe for TaskInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more