Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derive Clone on Bulk request structs #202

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion elasticsearch/src/root/bulk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ enum BulkAction {
///
/// the specific bulk action metadata such as the id of the source document, index, etc.
#[serde_with::skip_serializing_none]
#[derive(Serialize, Default)]
#[derive(Serialize, Default, Clone)]
struct BulkMetadata {
_index: Option<String>,
// TODO: intentionally omit type for now, as it's going away.
Expand All @@ -68,6 +68,7 @@ struct BulkMetadata {
///
/// The header contains the bulk action and the specific action metadata
/// such as the id of the source document, index, etc.
#[derive(Clone)]
struct BulkHeader {
action: BulkAction,
metadata: BulkMetadata,
Expand Down Expand Up @@ -152,6 +153,7 @@ impl Serialize for BulkHeader {
/// # Ok(())
/// # }
/// ```
#[derive(Clone)]
pub struct BulkOperation<B> {
header: BulkHeader,
source: Option<B>,
Expand Down