socks5_proto/handshake/
method.rs

1#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2#[repr(transparent)]
3pub struct Method(pub u8);
4
5impl Method {
6    pub const NONE: Self = Self(0x00);
7    pub const GSSAPI: Self = Self(0x01);
8    pub const PASSWORD: Self = Self(0x02);
9    pub const UNACCEPTABLE: Self = Self(0xff);
10}
11
12impl From<u8> for Method {
13    fn from(value: u8) -> Self {
14        Self(value)
15    }
16}
17
18impl From<Method> for u8 {
19    fn from(value: Method) -> Self {
20        value.0
21    }
22}