pub struct TcpClient {
pub host: String,
pub port: u16,
}
Available on crate features
client
and tcp-client
only.Expand description
The TCP client.
This Client
uses the TCP protocol to connect to a listener, to
read responses and write requests.
Fields§
§host: String
The TCP host the client should connect to.
port: u16
The TCP port the client should connect to.
Implementations§
Trait Implementations§
Source§impl Client for TcpClient
impl Client for TcpClient
Source§fn send<'life0, 'async_trait>(
&'life0 self,
req: Request,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
req: Request,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send the given request to the TCP server.
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send the start timer request.
Source§fn get<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Timer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Timer>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send the get timer request.
Source§fn set<'life0, 'async_trait>(
&'life0 self,
duration: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set<'life0, 'async_trait>(
&'life0 self,
duration: usize,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send the set timer request.
Source§fn pause<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pause<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send the pause timer request.
Auto Trait Implementations§
impl Freeze for TcpClient
impl RefUnwindSafe for TcpClient
impl Send for TcpClient
impl Sync for TcpClient
impl Unpin for TcpClient
impl UnwindSafe for TcpClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more