Skip to content

Commit 6e03ba7

Browse files
authored
Add a default implementation for Context. (#778)
1 parent b4914f8 commit 6e03ba7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lambda-runtime/src/types.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,20 @@ pub struct Context {
9494
pub env_config: RefConfig,
9595
}
9696

97+
impl Default for Context {
98+
fn default() -> Context {
99+
Context {
100+
request_id: "".to_owned(),
101+
deadline: 0,
102+
invoked_function_arn: "".to_owned(),
103+
xray_trace_id: None,
104+
client_context: None,
105+
identity: None,
106+
env_config: std::sync::Arc::new(crate::Config::default()),
107+
}
108+
}
109+
}
110+
97111
impl Context {
98112
/// Create a new [Context] struct based on the fuction configuration
99113
/// and the incoming request data.

0 commit comments

Comments
 (0)