MCPcopy Create free account
hub / github.com/aws/aws-lambda-rust-runtime / set_failures

Method set_failures

lambda-events/src/event/sqs/mod.rs:268–280  ·  view source on GitHub ↗

Set multiple failed message IDs at once. This is a convenience method for setting all batch item failures in one call. It replaces any previously registered failures. Besides `item_identifiers`, the generated struct will use default field values for [`BatchItemFailure`]. Important**: This feature requires `FunctionResponseTypes: ReportBatchItemFailures` to be enabled in your Lambda function's S

(&mut self, message_ids: I)

Source from the content-addressed store, hash-verified

266 /// }
267 /// ```
268 pub fn set_failures<I, S>(&mut self, message_ids: I)
269 where
270 I: IntoIterator<Item = S>,
271 S: Into<String>,
272 {
273 self.batch_item_failures = message_ids
274 .into_iter()
275 .map(|id| BatchItemFailure {
276 item_identifier: id.into(),
277 ..Default::default()
278 })
279 .collect();
280 }
281}
282
283#[non_exhaustive]

Calls 1

collectMethod · 0.80

Tested by

no test coverage detected