1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use std::net::SocketAddr;

/// The server's socket address, if it has been found
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum ServerAddr {
    /// Client has found the server's socket address
    Found(SocketAddr),
    /// Client is still finding the server's socket address
    Finding,
}

impl ServerAddr {
    pub fn is_found(&self) -> bool {
        match self {
            ServerAddr::Found(_) => true,
            ServerAddr::Finding => false,
        }
    }
}