[−][src]Struct tcpserver::TCPPeer
Fields
addr: SocketAddr
sender: Option<Sender<Vec<u8>>>
Implementations
impl TCPPeer
[src]
pub fn new(addr: SocketAddr, sender: Sender<Vec<u8>>) -> Arc<Actor<TCPPeer>>
[src]
创建一个TCP PEER
pub fn is_disconnect(&self) -> bool
[src]
是否断线
pub async fn send(
&self,
buff: Vec<u8>
) -> Result<(), Box<dyn Error + Send + Sync>>
[src]
&self,
buff: Vec<u8>
) -> Result<(), Box<dyn Error + Send + Sync>>
发送
pub async fn disconnect(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>
[src]
掐线
Auto Trait Implementations
impl !Dummy for TCPPeer
[src]
impl !RefUnwindSafe for TCPPeer
[src]
impl Send for TCPPeer
[src]
impl Sync for TCPPeer
[src]
impl Unpin for TCPPeer
[src]
impl !UnwindSafe for TCPPeer
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,