[][src]Struct protosocks::UserPassPacket

pub struct UserPassPacket<T: AsRef<[u8]>> { /* fields omitted */ }

Implementations

impl<T: AsRef<[u8]>> RequestPacket<T>[src]

pub fn new_unchecked(buffer: T) -> RequestPacket<T>[src]

Imbue a raw octet buffer with RFC1929 packet structure.

pub fn new_checked(buffer: T) -> Result<RequestPacket<T>, Error>[src]

Shorthand for a combination of new_unchecked and check_len.

pub fn check_len(&self) -> Result<(), Error>[src]

Ensure that no accessor method will panic if called. Returns Err(Error::Truncated) if the buffer is too short.

The result of this check is invalidated by calling [set_uname] and [set_passwd]

pub fn total_len(&self) -> usize[src]

Return the length.

pub fn version(&self) -> u8[src]

Return the version field.

pub fn ulen(&self) -> u8[src]

Return the ulen.

pub fn plen(&self) -> u8[src]

Return the plen.

impl<'a, T: AsRef<[u8]> + ?Sized> RequestPacket<&'a T>[src]

pub fn uname(&self) -> &'a [u8][src]

Return a pointer to the uname.

pub fn passwd(&self) -> &'a [u8][src]

Return a pointer to the passwd.

impl<T: AsRef<[u8]> + AsMut<[u8]>> RequestPacket<T>[src]

pub fn set_version(&mut self, value: u8)[src]

Set the version field.

pub fn set_uname(&mut self, value: &[u8])[src]

Set the uname.

pub fn set_passwd(&mut self, value: &[u8])[src]

Set the passwd.

pub fn uname_mut(&mut self) -> &mut [u8][src]

Return a mutable pointer to the uname.

pub fn passwd_mut(&mut self) -> &mut [u8][src]

Return a mutable pointer to the passwd.

Trait Implementations

impl<T: AsRef<[u8]>> AsRef<[u8]> for RequestPacket<T>[src]

impl<T: Clone + AsRef<[u8]>> Clone for RequestPacket<T>[src]

impl<T: Debug + AsRef<[u8]>> Debug for RequestPacket<T>[src]

impl<T: PartialEq + AsRef<[u8]>> PartialEq<RequestPacket<T>> for RequestPacket<T>[src]

impl<T: AsRef<[u8]>> StructuralPartialEq for RequestPacket<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for RequestPacket<T> where
    T: RefUnwindSafe

impl<T> Send for RequestPacket<T> where
    T: Send

impl<T> Sync for RequestPacket<T> where
    T: Sync

impl<T> Unpin for RequestPacket<T> where
    T: Unpin

impl<T> UnwindSafe for RequestPacket<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.