Loading...
Loading...
Anything usable as a connection key: cheap to store, compare, and hash, and safe to share across tasks. Blanket-implemented, so u64, String, a custom #[derive(Clone, PartialEq, Eq, Hash)] enum, etc. all qualify - no manual impl needed.
Anything usable to index connections in the `SocketManager`. Blanket-implemented for every `Eq + Hash + Clone + Send + Sync + 'static` type, so a `u64` user id, a `String` room name, a `Uuid`, or a custom enum all qualify with no manual impl. Keys of different types never collide, so you can key some connections by user id and others by room name in the same app.