pub struct AuthRequest {
pub ver: u8,
pub uname: String,
pub passwd: String,
}Expand description
Represents an authentication request from a client (RFC 1929 §2).
Fields§
§ver: u8Authentication protocol version (VER), always 0x01.
uname: StringThe username (UNAME).
passwd: StringThe password (PASSWD).
Implementations§
Trait Implementations§
Source§impl TryFrom<&[u8]> for AuthRequest
impl TryFrom<&[u8]> for AuthRequest
Source§fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>
fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>
Parses an authentication request from raw bytes.
§Errors
SocksError::AuthMessageTooShortif the message is shorter than 2 bytes.SocksError::UnsupportedAuthVersionifVER != 0x01.SocksError::AuthFailedif the username or password are invalid UTF-8, or the buffer is truncated before expected fields.
Source§type Error = SocksError
type Error = SocksError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for AuthRequest
impl RefUnwindSafe for AuthRequest
impl Send for AuthRequest
impl Sync for AuthRequest
impl Unpin for AuthRequest
impl UnwindSafe for AuthRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more