pub unsafe trait Split { }
Expand description
This is a dummy unsafe trait to inform monoio,
the object with has this Split
trait can be safely split
to read/write object in both form of Owned
or Borrowed
.
§Safety
monoio cannot guarantee whether the custom object can be
safely split to divided objects. Users should ensure the read
operations are indenpendence from the write ones, the methods
from AsyncReadRent
and AsyncWriteRent
can execute concurrently.
Implementors§
impl Split for TcpStream
TcpStream is safe to split to two parts
impl Split for UdpSocket
UdpSocket is safe to split to two parts
impl Split for UnixStream
UnixStream is safe to split to two parts
impl<I, P> Split for PrefixedReadIo<I, P>where
I: Split,
implement unsafe Split for PrefixedReadIo, it’s safe
because read/write are independent, we can safely split them into two I/O parts.