Trait ux::prelude::SocketConnectionExt [−]
pub trait SocketConnectionExt: 'static {
pub fn connect<P, Q>(
&self,
address: &P,
cancellable: Option<&Q>
) -> Result<(), Error>
where
P: IsA<SocketAddress>,
Q: IsA<Cancellable>;
pub fn connect_async<P, Q, R>(
&self,
address: &P,
cancellable: Option<&Q>,
callback: R
)
where
P: IsA<SocketAddress>,
Q: IsA<Cancellable>,
R: 'static + FnOnce(Result<(), Error>) + Send;
pub fn connect_async_future<P>(
&self,
address: &P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static, Global>>
where
P: 'static + IsA<SocketAddress> + Clone;
pub fn get_local_address(&self) -> Result<SocketAddress, Error>;
pub fn get_remote_address(&self) -> Result<SocketAddress, Error>;
pub fn get_socket(&self) -> Option<Socket>;
pub fn is_connected(&self) -> bool;
}Required methods
pub fn connect<P, Q>(
&self,
address: &P,
cancellable: Option<&Q>
) -> Result<(), Error> where
P: IsA<SocketAddress>,
Q: IsA<Cancellable>,
&self,
address: &P,
cancellable: Option<&Q>
) -> Result<(), Error> where
P: IsA<SocketAddress>,
Q: IsA<Cancellable>,
pub fn connect_async<P, Q, R>(
&self,
address: &P,
cancellable: Option<&Q>,
callback: R
) where
P: IsA<SocketAddress>,
Q: IsA<Cancellable>,
R: 'static + FnOnce(Result<(), Error>) + Send,
&self,
address: &P,
cancellable: Option<&Q>,
callback: R
) where
P: IsA<SocketAddress>,
Q: IsA<Cancellable>,
R: 'static + FnOnce(Result<(), Error>) + Send,
pub fn connect_async_future<P>(
&self,
address: &P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static, Global>> where
P: 'static + IsA<SocketAddress> + Clone,
&self,
address: &P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static, Global>> where
P: 'static + IsA<SocketAddress> + Clone,
pub fn get_local_address(&self) -> Result<SocketAddress, Error>
pub fn get_remote_address(&self) -> Result<SocketAddress, Error>
pub fn get_socket(&self) -> Option<Socket>
pub fn is_connected(&self) -> bool
Implementors
impl<O> SocketConnectionExt for O where
O: IsA<SocketConnection>,
O: IsA<SocketConnection>,
pub fn connect<P, Q>(
&self,
address: &P,
cancellable: Option<&Q>
) -> Result<(), Error> where
P: IsA<SocketAddress>,
Q: IsA<Cancellable>,
&self,
address: &P,
cancellable: Option<&Q>
) -> Result<(), Error> where
P: IsA<SocketAddress>,
Q: IsA<Cancellable>,
pub fn connect_async<P, Q, R>(
&self,
address: &P,
cancellable: Option<&Q>,
callback: R
) where
P: IsA<SocketAddress>,
Q: IsA<Cancellable>,
R: 'static + FnOnce(Result<(), Error>) + Send,
&self,
address: &P,
cancellable: Option<&Q>,
callback: R
) where
P: IsA<SocketAddress>,
Q: IsA<Cancellable>,
R: 'static + FnOnce(Result<(), Error>) + Send,
pub fn connect_async_future<P>(
&self,
address: &P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static, Global>> where
P: 'static + IsA<SocketAddress> + Clone,
&self,
address: &P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'static, Global>> where
P: 'static + IsA<SocketAddress> + Clone,