pub struct TCPPeer<T> {
pub addr: SocketAddr,
pub sender: Option<WriteHalf<T>>,
}Fields
addr: SocketAddrsender: Option<WriteHalf<T>>Implementations
sourceimpl<T> TCPPeer<T> where
T: AsyncRead + AsyncWrite + Send + 'static,
impl<T> TCPPeer<T> where
T: AsyncRead + AsyncWrite + Send + 'static,
sourcepub fn is_disconnect(&self) -> bool
pub fn is_disconnect(&self) -> bool
是否断线
sourcepub async fn disconnect(&mut self) -> Result<()>
pub async fn disconnect(&mut self) -> Result<()>
掐线
Auto Trait Implementations
impl<T> !RefUnwindSafe for TCPPeer<T>
impl<T> Send for TCPPeer<T> where
T: Send,
impl<T> Sync for TCPPeer<T> where
T: Sync,
impl<T> Unpin for TCPPeer<T>
impl<T> !UnwindSafe for TCPPeer<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more