Struct meilisearch_sdk::indexes::IndexUpdater
source · pub struct IndexUpdater<'a, Http: HttpClient> {
pub client: &'a Client<Http>,
pub uid: String,
pub primary_key: Option<String>,
}Expand description
An IndexUpdater used to update the specifics of an index.
§Example
let task = IndexUpdater::new("index_updater", &client)
.with_primary_key("special_id")
.execute()
.await
.unwrap()
.wait_for_completion(&client, None, None)
.await
.unwrap();
let index = client.get_index("index_updater").await.unwrap();
assert_eq!(index.primary_key, Some("special_id".to_string()));Fields§
§client: &'a Client<Http>§uid: String§primary_key: Option<String>Implementations§
source§impl<'a, Http: HttpClient> IndexUpdater<'a, Http>
impl<'a, Http: HttpClient> IndexUpdater<'a, Http>
pub fn new( uid: impl AsRef<str>, client: &Client<Http>, ) -> IndexUpdater<'_, Http>
sourcepub fn with_primary_key(
&mut self,
primary_key: impl AsRef<str>,
) -> &mut IndexUpdater<'a, Http>
pub fn with_primary_key( &mut self, primary_key: impl AsRef<str>, ) -> &mut IndexUpdater<'a, Http>
Define the new primary_key to set on the Index.
§Example
let task = IndexUpdater::new("index_updater_with_primary_key", &client)
.with_primary_key("special_id")
.execute()
.await
.unwrap()
.wait_for_completion(&client, None, None)
.await
.unwrap();
let index = client.get_index("index_updater_with_primary_key").await.unwrap();
assert_eq!(index.primary_key, Some("special_id".to_string()));sourcepub async fn execute(&'a self) -> Result<TaskInfo, Error>
pub async fn execute(&'a self) -> Result<TaskInfo, Error>
Execute the update of an Index using the IndexUpdater.
§Example
let task = IndexUpdater::new("index_updater_execute", &client)
.with_primary_key("special_id")
.execute()
.await
.unwrap()
.wait_for_completion(&client, None, None)
.await
.unwrap();
let index = client.get_index("index_updater_execute").await.unwrap();
assert_eq!(index.primary_key, Some("special_id".to_string()));Trait Implementations§
source§impl<'a, Http: HttpClient> AsRef<IndexUpdater<'a, Http>> for IndexUpdater<'a, Http>
impl<'a, Http: HttpClient> AsRef<IndexUpdater<'a, Http>> for IndexUpdater<'a, Http>
source§fn as_ref(&self) -> &IndexUpdater<'a, Http>
fn as_ref(&self) -> &IndexUpdater<'a, Http>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<Http: HttpClient> AsRef<str> for IndexUpdater<'_, Http>
impl<Http: HttpClient> AsRef<str> for IndexUpdater<'_, Http>
source§impl<'a, Http: Clone + HttpClient> Clone for IndexUpdater<'a, Http>
impl<'a, Http: Clone + HttpClient> Clone for IndexUpdater<'a, Http>
source§fn clone(&self) -> IndexUpdater<'a, Http>
fn clone(&self) -> IndexUpdater<'a, Http>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<'a, Http: Debug + HttpClient> Debug for IndexUpdater<'a, Http>
impl<'a, Http: Debug + HttpClient> Debug for IndexUpdater<'a, Http>
source§impl<'a, Http: HttpClient> Serialize for IndexUpdater<'a, Http>
impl<'a, Http: HttpClient> Serialize for IndexUpdater<'a, Http>
Auto Trait Implementations§
impl<'a, Http> Freeze for IndexUpdater<'a, Http>
impl<'a, Http> RefUnwindSafe for IndexUpdater<'a, Http>where
Http: RefUnwindSafe,
impl<'a, Http> Send for IndexUpdater<'a, Http>
impl<'a, Http> Sync for IndexUpdater<'a, Http>
impl<'a, Http> Unpin for IndexUpdater<'a, Http>
impl<'a, Http> UnwindSafe for IndexUpdater<'a, Http>where
Http: RefUnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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