[][src]Struct tcpserver::TCPPeer

pub struct TCPPeer {
    pub addr: SocketAddr,
    pub reader: OwnedReadHalf,
    pub sender: Sender<XBWrite>,
}

Fields

addr: SocketAddrreader: OwnedReadHalfsender: Sender<XBWrite>

Implementations

impl TCPPeer[src]

pub fn new(
    addr: SocketAddr,
    reader: OwnedReadHalf,
    sender: Sender<XBWrite>
) -> TCPPeer
[src]

创建一个TCP PEER

pub fn get_sender(&self) -> Sender<XBWrite>[src]

获取发送句柄

pub async fn send<'_>(&'_ self, buff: XBWrite) -> Result<(), Box<dyn Error>>[src]

发送

pub async fn send_mut<'_>(
    &'_ mut self,
    buff: XBWrite
) -> Result<(), Box<dyn Error>>
[src]

发送 mut 版

pub async fn disconnect<'_>(&'_ mut self) -> Result<(), Box<dyn Error>>[src]

掐线

Auto Trait Implementations

impl !RefUnwindSafe for TCPPeer

impl Send for TCPPeer

impl Sync for TCPPeer

impl Unpin for TCPPeer

impl !UnwindSafe for TCPPeer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.