Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::net::TcpStream;
- use std::hash::{Hash, Hasher};
- struct Connection {
- name: String,
- stream: TcpStream,
- }
- impl Eq for Connection {}
- impl PartialEq for Connection {
- fn eq(&self, other: &Self) -> bool {
- self.name == other.name
- }
- }
- impl Hash for Connection {
- fn hash<H: Hasher>(&self, state: &mut H) {
- self.name.hash(state);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement