Skip to content

Commit f302319

Browse files
authored
Update documentation for set_failures method
Use `..Default::default()` and add note about default field values for KinesisBatchItemFailure.
1 parent cda4a4d commit f302319

File tree

1 file changed

+3
-0
lines changed
  • lambda-events/src/event/streams

1 file changed

+3
-0
lines changed

lambda-events/src/event/streams/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ impl KinesisEventResponse {
4040
/// This is a convenience method for setting all batch item failures in one call.
4141
/// It replaces any previously registered failures.
4242
///
43+
/// Besides `item_identifiers`, the generated struct will use default field values for [`KinesisBatchItemFailure`].
44+
///
4345
/// **Important**: This feature requires `FunctionResponseTypes: ReportBatchItemFailures`
4446
/// to be enabled in your Lambda function's Kinesis event source mapping configuration.
4547
/// Without this setting, Lambda will retry the entire batch on any failure.
@@ -54,6 +56,7 @@ impl KinesisEventResponse {
5456
item_identifier: Some(id.into()),
5557
#[cfg(feature = "catch-all-fields")]
5658
other: serde_json::Map::new(),
59+
..Default::default()
5760
})
5861
.collect();
5962
}

0 commit comments

Comments
 (0)