Hash and eq for session

This commit is contained in:
2026-02-23 07:41:02 +01:00
parent a26a6b75a0
commit 6933524cff
+15
View File
@@ -1,3 +1,4 @@
use std::hash::Hash;
use std::{collections::HashMap, sync::Arc};
use serde::{Deserialize, Serialize};
@@ -259,3 +260,17 @@ impl Session {
Ok(res?)
}
}
impl Hash for Session {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.ws.id.hash(state);
}
}
impl PartialEq for Session {
fn eq(&self, other: &Self) -> bool {
self.ws.id == other.ws.id
}
}
impl Eq for Session {}