pub struct Credentials {
pub username: Vec<u8>,
pub password: Vec<u8>,
}
Expand description
Represents the username and password credentials for SOCKS authentication.
Fields§
§username: Vec<u8>
The username as a byte vector.
password: Vec<u8>
The password as a byte vector.
Implementations§
Source§impl Credentials
impl Credentials
Sourcepub fn new<S: Into<Vec<u8>>>(username: S, password: S) -> Self
pub fn new<S: Into<Vec<u8>>>(username: S, password: S) -> Self
Creates a new Credentials
instance.
§Parameters
username
: The username as a byte vector or convertible to a byte vector.password
: The password as a byte vector or convertible to a byte vector.
Sourcepub fn as_socks_bytes(&self) -> Vec<u8>
pub fn as_socks_bytes(&self) -> Vec<u8>
Converts the Credentials
into a byte sequence compatible with the SOCKS authentication protocol.
§Returns
Returns a vector of bytes containing the username and password in SOCKS-compatible format.
Trait Implementations§
Source§impl Clone for Credentials
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Credentials
impl Debug for Credentials
Source§impl PartialEq for Credentials
impl PartialEq for Credentials
impl StructuralPartialEq for Credentials
Auto Trait Implementations§
impl Freeze for Credentials
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnwindSafe for Credentials
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