puzz_server/
lib.rs

1#![forbid(unsafe_code)]
2
3use std::{fmt, net::SocketAddr};
4
5#[cfg(feature = "actix")]
6mod actix;
7#[cfg(feature = "actix")]
8pub use actix::Server;
9
10#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
11pub struct PeerAddr(pub SocketAddr);
12
13impl fmt::Debug for PeerAddr {
14    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
15        <SocketAddr as fmt::Debug>::fmt(&self.0, f)
16    }
17}
18
19impl fmt::Display for PeerAddr {
20    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
21        <SocketAddr as fmt::Display>::fmt(&self.0, f)
22    }
23}