Struct elastic::client::responses::BulkErrorsResponse
[−]
pub struct BulkErrorsResponse<TIndex = String, TType = String, TId = String> { pub took: u64, pub items: Vec<BulkItemError<TIndex, TType, TId>>, // some fields omitted }
Response for a bulk request.
This type only accumulates bulk operations that failed. It can be more efficient if you only care about errors.
Examples
Send a bulk request and iterate through the errors:
// Send a request (omitted, see `samples/bulk`), and read the response. // Parse body to JSON as an elastic_responses::BulkErrorsResponse object let body_as_json: BulkErrorsResponse = do_request(); // Do something with failed operations for op in body_as_json.items { match op.action { BulkAction::Delete => (), // Ignore failed deletes _ => println!("bulk op failed: {:?}", op) } }
Fields
took: u64
items: Vec<BulkItemError<TIndex, TType, TId>>
Methods
impl<TIndex, TType, TId> BulkErrorsResponse<TIndex, TType, TId>
Trait Implementations
impl<'de, TIndex, TType, TId> Deserialize<'de> for BulkErrorsResponse<TIndex, TType, TId> where
TId: Deserialize<'de>,
TIndex: Deserialize<'de>,
TType: Deserialize<'de>,
TId: Deserialize<'de>,
TIndex: Deserialize<'de>,
TType: Deserialize<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<BulkErrorsResponse<TIndex, TType, TId>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
__deserializer: __D
) -> Result<BulkErrorsResponse<TIndex, TType, TId>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl<TIndex, TType, TId> IsOk for BulkErrorsResponse<TIndex, TType, TId>
fn is_ok<B>(
head: HttpResponseHead,
body: Unbuffered<B>
) -> Result<MaybeOkResponse<B>, ParseResponseError> where
B: ResponseBody,
head: HttpResponseHead,
body: Unbuffered<B>
) -> Result<MaybeOkResponse<B>, ParseResponseError> where
B: ResponseBody,
Inspect the http response to determine whether or not it succeeded.
impl<TIndex, TType, TId> Debug for BulkErrorsResponse<TIndex, TType, TId> where
TId: Debug,
TIndex: Debug,
TType: Debug,
TId: Debug,
TIndex: Debug,
TType: Debug,
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl<TIndex, TType, TId> Clone for BulkErrorsResponse<TIndex, TType, TId> where
TId: Clone,
TIndex: Clone,
TType: Clone,
TId: Clone,
TIndex: Clone,
TType: Clone,