Skip to content

Commit

Permalink
feat: add a default implementation for Context struct (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
sighphyre authored Jan 24, 2023
1 parent f095fac commit 9e6aa99
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/client_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ where
}))
}

impl Default for Context {
fn default() -> Self {
Self {
user_id: None,
session_id: None,
environment: None,
current_time: None,
app_name: None,
remote_address: None,
properties: Some(HashMap::new()),
}
}
}

impl<'de> Deserialize<'de> for Operator {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down

0 comments on commit 9e6aa99

Please sign in to comment.