pub struct TcpClient<T> { /* private fields */ }
Implementations§
Source§impl<T> TcpClient<T>
impl<T> TcpClient<T>
pub async fn connect_stream_type<H: ToSocketAddrs, F: Future<Output = Result<bool>> + Send + 'static, S: Future<Output = Result<T>> + Send + 'static, A: Send + 'static>( addr: H, stream_init: impl FnOnce(TcpStream) -> S + Send + 'static, input: impl FnOnce(A, Arc<Actor<TcpClient<T>>>, ReadHalf<T>) -> F + Send + 'static, token: A, ) -> Result<Arc<Actor<TcpClient<T>>>>
pub async fn disconnect(&mut self) -> Result<()>
pub async fn send(&mut self, buff: &[u8]) -> Result<usize>
pub async fn flush(&mut self) -> Result<()>
Auto Trait Implementations§
impl<T> Freeze for TcpClient<T>
impl<T> RefUnwindSafe for TcpClient<T>
impl<T> Send for TcpClient<T>where
T: Send,
impl<T> Sync for TcpClient<T>where
T: Sync,
impl<T> Unpin for TcpClient<T>
impl<T> UnwindSafe for TcpClient<T>
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