socks5_impl::protocol

Trait StreamOperation

Source
pub trait StreamOperation {
    // Required methods
    fn retrieve_from_stream<R>(stream: &mut R) -> Result<Self>
       where R: Read,
             Self: Sized;
    fn write_to_buf<B: BufMut>(&self, buf: &mut B);
    fn len(&self) -> usize;

    // Provided methods
    fn write_to_stream<W: Write>(&self, w: &mut W) -> Result<()> { ... }
    fn is_empty(&self) -> bool { ... }
}

Required Methods§

Source

fn retrieve_from_stream<R>(stream: &mut R) -> Result<Self>
where R: Read, Self: Sized,

Source

fn write_to_buf<B: BufMut>(&self, buf: &mut B)

Source

fn len(&self) -> usize

Provided Methods§

Source

fn write_to_stream<W: Write>(&self, w: &mut W) -> Result<()>

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl StreamOperation for Address

Source§

impl StreamOperation for socks5_impl::protocol::handshake::password_method::Request

Source§

impl StreamOperation for socks5_impl::protocol::handshake::password_method::Response

Source§

impl StreamOperation for socks5_impl::protocol::handshake::Request

Source§

impl StreamOperation for socks5_impl::protocol::handshake::Response

Source§

impl StreamOperation for socks5_impl::protocol::Request

Source§

impl StreamOperation for socks5_impl::protocol::Response

Source§

impl StreamOperation for UdpHeader