Enum socks5_protocol::Address[][src]

pub enum Address {
    SocketAddr(SocketAddr),
    Domain(Stringu16),
}
Expand description

Address type in socks5.

Variants

SocketAddr(SocketAddr)
Expand description

SocketAddr

Domain(Stringu16)
Expand description

Domain

Implementations

impl Address[src]

pub fn to_socket_addr(self) -> Result<SocketAddr>[src]

Convert Address to SocketAddr. If Address is a domain, return std::io::ErrorKind::InvalidInput

pub async fn write<W>(&self, writer: W) -> Result<()> where
    W: AsyncWrite + Unpin
[src]

Write Address to AsyncWrite.

pub async fn read<R>(reader: R) -> Result<Self> where
    R: AsyncRead + Unpin
[src]

Read Address from AsyncRead.

Trait Implementations

impl Debug for Address[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Address[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl Display for Address[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<SocketAddr> for Address[src]

fn from(addr: SocketAddr) -> Self[src]

Performs the conversion.

impl FromIO for Address[src]

fn read_from(reader: &mut impl Read) -> Result<Self> where
    Self: Sized
[src]

Read Self from io::Read.

fn write_to(&self, writer: &mut impl Write) -> Result<()>[src]

Write Self to io::Write.

impl FromStr for Address[src]

type Err = Error

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

Parses a string s to return a value of this type. Read more

Auto Trait Implementations

impl RefUnwindSafe for Address

impl Send for Address

impl Sync for Address

impl Unpin for Address

impl UnwindSafe for Address

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.