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

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>, 

impl<TIndex, TType, TId> IsOk for BulkErrorsResponse<TIndex, TType, TId>

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

Formats the value using the given formatter.

impl<TIndex, TType, TId> Clone for BulkErrorsResponse<TIndex, TType, TId> where
    TId: Clone,
    TIndex: Clone,
    TType: Clone