pub trait SocketClientExt: 'static {
Show 43 methods
// Required methods
fn add_application_proxy(&self, protocol: &str);
fn connect(
&self,
connectable: &impl IsA<SocketConnectable>,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<SocketConnection, Error>;
fn connect_async<P: FnOnce(Result<SocketConnection, Error>) + 'static>(
&self,
connectable: &impl IsA<SocketConnectable>,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
);
fn connect_future(
&self,
connectable: &impl IsA<SocketConnectable> + Clone + 'static
) -> Pin<Box_<dyn Future<Output = Result<SocketConnection, Error>> + 'static>>;
fn connect_to_host(
&self,
host_and_port: &str,
default_port: u16,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<SocketConnection, Error>;
fn connect_to_host_async<P: FnOnce(Result<SocketConnection, Error>) + 'static>(
&self,
host_and_port: &str,
default_port: u16,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
);
fn connect_to_host_future(
&self,
host_and_port: &str,
default_port: u16
) -> Pin<Box_<dyn Future<Output = Result<SocketConnection, Error>> + 'static>>;
fn connect_to_service(
&self,
domain: &str,
service: &str,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<SocketConnection, Error>;
fn connect_to_service_async<P: FnOnce(Result<SocketConnection, Error>) + 'static>(
&self,
domain: &str,
service: &str,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
);
fn connect_to_service_future(
&self,
domain: &str,
service: &str
) -> Pin<Box_<dyn Future<Output = Result<SocketConnection, Error>> + 'static>>;
fn connect_to_uri(
&self,
uri: &str,
default_port: u16,
cancellable: Option<&impl IsA<Cancellable>>
) -> Result<SocketConnection, Error>;
fn connect_to_uri_async<P: FnOnce(Result<SocketConnection, Error>) + 'static>(
&self,
uri: &str,
default_port: u16,
cancellable: Option<&impl IsA<Cancellable>>,
callback: P
);
fn connect_to_uri_future(
&self,
uri: &str,
default_port: u16
) -> Pin<Box_<dyn Future<Output = Result<SocketConnection, Error>> + 'static>>;
fn enables_proxy(&self) -> bool;
fn family(&self) -> SocketFamily;
fn local_address(&self) -> Option<SocketAddress>;
fn protocol(&self) -> SocketProtocol;
fn proxy_resolver(&self) -> ProxyResolver;
fn socket_type(&self) -> SocketType;
fn timeout(&self) -> u32;
fn is_tls(&self) -> bool;
fn tls_validation_flags(&self) -> TlsCertificateFlags;
fn set_enable_proxy(&self, enable: bool);
fn set_family(&self, family: SocketFamily);
fn set_local_address(&self, address: Option<&impl IsA<SocketAddress>>);
fn set_protocol(&self, protocol: SocketProtocol);
fn set_proxy_resolver(
&self,
proxy_resolver: Option<&impl IsA<ProxyResolver>>
);
fn set_socket_type(&self, type_: SocketType);
fn set_timeout(&self, timeout: u32);
fn set_tls(&self, tls: bool);
fn set_tls_validation_flags(&self, flags: TlsCertificateFlags);
fn type_(&self) -> SocketType;
fn set_type(&self, type_: SocketType);
fn connect_event<F: Fn(&Self, SocketClientEvent, &SocketConnectable, Option<&IOStream>) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_enable_proxy_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_family_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_local_address_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_protocol_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_proxy_resolver_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_timeout_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_tls_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_tls_validation_flags_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_type_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}