hyper_util/client/legacy/connect/proxy/socks/v4/
errors.rs

1use super::Status;
2
3#[derive(Debug)]
4pub enum SocksV4Error {
5    IpV6,
6    Command(Status),
7}
8
9impl From<Status> for SocksV4Error {
10    fn from(err: Status) -> Self {
11        Self::Command(err)
12    }
13}
14
15impl std::fmt::Display for SocksV4Error {
16    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17        match self {
18            Self::IpV6 => f.write_str("IPV6 is not supported"),
19            Self::Command(status) => status.fmt(f),
20        }
21    }
22}