[][src]Trait gio::ProxyExt

pub trait ProxyExt: 'static {
    fn connect<P: IsA<IOStream>, Q: IsA<ProxyAddress>, R: IsA<Cancellable>>(
        &self,
        connection: &P,
        proxy_address: &Q,
        cancellable: Option<&R>
    ) -> Result<IOStream, Error>;
fn connect_async<P: IsA<IOStream>, Q: IsA<ProxyAddress>, R: IsA<Cancellable>, S: FnOnce(Result<IOStream, Error>) + Send + 'static>(
        &self,
        connection: &P,
        proxy_address: &Q,
        cancellable: Option<&R>,
        callback: S
    );
fn connect_async_future<P: IsA<IOStream> + Clone + 'static, Q: IsA<ProxyAddress> + Clone + 'static>(
        &self,
        connection: &P,
        proxy_address: &Q
    ) -> Pin<Box_<dyn Future<Output = Result<IOStream, Error>> + 'static>>;
fn supports_hostname(&self) -> bool; }

Trait containing all Proxy methods.

Implementors

Proxy

Required methods

fn connect<P: IsA<IOStream>, Q: IsA<ProxyAddress>, R: IsA<Cancellable>>(
    &self,
    connection: &P,
    proxy_address: &Q,
    cancellable: Option<&R>
) -> Result<IOStream, Error>

Given connection to communicate with a proxy (eg, a SocketConnection that is connected to the proxy server), this does the necessary handshake to connect to proxy_address, and if required, wraps the IOStream to handle proxy payload.

connection

a IOStream

proxy_address

a ProxyAddress

cancellable

a Cancellable

Returns

a IOStream that will replace connection. This might be the same as connection, in which case a reference will be added.

fn connect_async<P: IsA<IOStream>, Q: IsA<ProxyAddress>, R: IsA<Cancellable>, S: FnOnce(Result<IOStream, Error>) + Send + 'static>(
    &self,
    connection: &P,
    proxy_address: &Q,
    cancellable: Option<&R>,
    callback: S
)

Asynchronous version of Proxy::connect.

connection

a IOStream

proxy_address

a ProxyAddress

cancellable

a Cancellable

callback

a GAsyncReadyCallback

user_data

callback data

fn connect_async_future<P: IsA<IOStream> + Clone + 'static, Q: IsA<ProxyAddress> + Clone + 'static>(
    &self,
    connection: &P,
    proxy_address: &Q
) -> Pin<Box_<dyn Future<Output = Result<IOStream, Error>> + 'static>>

fn supports_hostname(&self) -> bool

Some proxy protocols expect to be passed a hostname, which they will resolve to an IP address themselves. Others, like SOCKS4, do not allow this. This function will return false if self is implementing such a protocol. When false is returned, the caller should resolve the destination hostname first, and then pass a ProxyAddress containing the stringified IP address to Proxy::connect or Proxy::connect_async.

Returns

true if hostname resolution is supported.

Loading content...

Implementors

impl<O: IsA<Proxy>> ProxyExt for O[src]

Loading content...