summaryrefslogtreecommitdiff
path: root/protocol/src/member.rs
diff options
context:
space:
mode:
Diffstat (limited to 'protocol/src/member.rs')
-rw-r--r--protocol/src/member.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/protocol/src/member.rs b/protocol/src/member.rs
new file mode 100644
index 0000000..a892118
--- /dev/null
+++ b/protocol/src/member.rs
@@ -0,0 +1,29 @@
+use crate::member::email::EMailAddress;
+use serde::{Deserialize, Serialize};
+
+pub mod email;
+pub mod error;
+
+#[derive(Debug, Clone, Eq, Serialize, Deserialize)]
+pub struct Member {
+ name: String,
+ mail: EMailAddress,
+}
+
+impl PartialEq for Member {
+ fn eq(&self, other: &Self) -> bool {
+ self.mail == other.mail
+ }
+}
+
+impl std::hash::Hash for Member {
+ fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
+ self.mail.hash(state);
+ }
+}
+
+impl std::fmt::Display for Member {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "{}", self.name)
+ }
+}