-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when I'm not able to return back BulkParts
from a function.
Often we just create Index
by using part of my data but the following code won't compile
fn build_bulk<'a>(
proximity_uuid: &'a str,
alerts: Vec<Alert>,
) -> (BulkParts<'a>, Vec<JsonBody<Value>>) {
let bulk_parts = BulkParts::Index(&format!("alerts.{}", proximity_uuid));
let body: Vec<JsonBody<_>> = alerts
.into_iter()
.map(|alert| {
vec![
JsonBody::from(json!({"index": {"_id": Uuid::new_v4().to_simple().to_string() }})),
JsonBody::from(json!(alert)),
]
})
.flatten()
.collect();
(bulk_parts, body)
}
Describe the solution you'd like
A clear and concise description of what you want to happen.
Make it possible to return back a BulkParts
from a function
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request