pub struct BulkOperation { /* private fields */ }Expand description
One entry in a bulk request.
Implementations§
Source§impl BulkOperation
impl BulkOperation
Sourcepub fn index(document: Json) -> BulkOperation
pub fn index(document: Json) -> BulkOperation
Write a document, replacing whatever was at the id.
With no BulkOperation::id the cluster generates one, which is
faster — it can skip the lookup that a given id forces — and right for
append-only data like logs.
Sourcepub fn create(id: impl Into<String>, document: Json) -> BulkOperation
pub fn create(id: impl Into<String>, document: Json) -> BulkOperation
Write a document only if nothing is at the id yet.
Fails that item with a version conflict rather than overwriting, which makes a bulk load safe to repeat after a partial failure.
Sourcepub fn update(id: impl Into<String>, fields: Json) -> BulkOperation
pub fn update(id: impl Into<String>, fields: Json) -> BulkOperation
Merge these fields into the document, leaving the rest alone.
pub fn delete(id: impl Into<String>) -> BulkOperation
Sourcepub fn id(self, id: impl Into<String>) -> BulkOperation
pub fn id(self, id: impl Into<String>) -> BulkOperation
Give this operation an id, for an BulkOperation::index that should
overwrite a known document.
Sourcepub fn in_index(self, index: impl Into<String>) -> BulkOperation
pub fn in_index(self, index: impl Into<String>) -> BulkOperation
Send this one to a different index than the rest of the request.
Trait Implementations§
Source§impl Clone for BulkOperation
impl Clone for BulkOperation
Source§impl Debug for BulkOperation
impl Debug for BulkOperation
Source§impl PartialEq for BulkOperation
impl PartialEq for BulkOperation
impl StructuralPartialEq for BulkOperation
Auto Trait Implementations§
impl Freeze for BulkOperation
impl RefUnwindSafe for BulkOperation
impl Send for BulkOperation
impl Sync for BulkOperation
impl Unpin for BulkOperation
impl UnsafeUnpin for BulkOperation
impl UnwindSafe for BulkOperation
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