pub struct Handle<T> { /* private fields */ }Expand description
Handle that manages IO submitted to proactor system.
This handle wraps io element, its’ completion channel, if file, file buffers and input output operations It is single handedly responsible for dispatching correct operations to IO driver. Speed of IO bound to speed of executor, handle neither interferes with executor nor tightly coupled.
Implementations§
Source§impl Handle<TcpListener>
impl Handle<TcpListener>
Source§impl Handle<TcpStream>
impl Handle<TcpStream>
pub async fn connect<A>(sock_addrs: A) -> Result<Handle<TcpStream>, Error>where
A: ToSocketAddrs,
pub async fn send(&self, buf: &[u8]) -> Result<usize, Error>
pub async fn recv(&self, buf: &mut [u8]) -> Result<usize, Error>
pub async fn peek(&self, buf: &mut [u8]) -> Result<usize, Error>
Source§impl Handle<UdpSocket>
impl Handle<UdpSocket>
pub fn bind<A>(addr: A) -> Result<Handle<UdpSocket>, Error>where
A: ToSocketAddrs,
pub async fn connect<A>(sock_addrs: A) -> Result<Handle<UdpSocket>, Error>where
A: ToSocketAddrs,
pub async fn send(&self, buf: &[u8]) -> Result<usize, Error>
pub async fn recv(&self, buf: &mut [u8]) -> Result<usize, Error>
pub async fn peek(&self, buf: &mut [u8]) -> Result<usize, Error>
pub async fn send_to<A>(&self, buf: &[u8], addr: A) -> Result<usize, Error>where
A: ToSocketAddrs,
pub async fn recv_from( &self, buf: &mut [u8], ) -> Result<(usize, SocketAddr), Error>
pub async fn peek_from( &self, buf: &mut [u8], ) -> Result<(usize, SocketAddr), Error>
Source§impl Handle<UnixListener>
impl Handle<UnixListener>
Source§impl Handle<UnixStream>
impl Handle<UnixStream>
pub async fn connect<P>(path: P) -> Result<Handle<UnixStream>, Error>
pub fn pair() -> Result<(Handle<UnixStream>, Handle<UnixStream>), Error>
pub async fn send(&self, buf: &[u8]) -> Result<usize, Error>
pub async fn recv(&self, buf: &mut [u8]) -> Result<usize, Error>
pub async fn peek(&self, buf: &mut [u8]) -> Result<usize, Error>
Source§impl Handle<UnixDatagram>
impl Handle<UnixDatagram>
pub fn bind<P>(path: P) -> Result<Handle<UnixDatagram>, Error>
pub fn pair() -> Result<(Handle<UnixDatagram>, Handle<UnixDatagram>), Error>
pub async fn send(&self, buf: &[u8]) -> Result<usize, Error>
pub async fn recv(&self, buf: &mut [u8]) -> Result<usize, Error>
pub async fn peek(&self, buf: &mut [u8]) -> Result<usize, Error>
pub async fn send_to<P>(&self, buf: &[u8], path: P) -> Result<usize, Error>
pub async fn recv_from( &self, buf: &mut [u8], ) -> Result<(usize, SocketAddr), Error>
pub async fn peek_from( &self, buf: &mut [u8], ) -> Result<(usize, SocketAddr), Error>
Trait Implementations§
Source§impl AsyncRead for &Handle<File>
impl AsyncRead for &Handle<File>
Source§impl AsyncRead for &Handle<TcpStream>
impl AsyncRead for &Handle<TcpStream>
Source§impl AsyncRead for &Handle<UnixStream>
impl AsyncRead for &Handle<UnixStream>
Source§impl AsyncRead for Handle<File>
impl AsyncRead for Handle<File>
Source§impl AsyncRead for Handle<TcpStream>
impl AsyncRead for Handle<TcpStream>
Source§impl AsyncRead for Handle<UnixStream>
impl AsyncRead for Handle<UnixStream>
Source§impl AsyncWrite for &Handle<File>
impl AsyncWrite for &Handle<File>
Source§fn poll_write(
self: Pin<&mut &Handle<File>>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut &Handle<File>>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf into the object. Read moreSource§fn poll_flush(
self: Pin<&mut &Handle<File>>,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut &Handle<File>>, _cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach
their destination. Read more
Source§impl AsyncWrite for &Handle<TcpStream>
impl AsyncWrite for &Handle<TcpStream>
Source§fn poll_write(
self: Pin<&mut &Handle<TcpStream>>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut &Handle<TcpStream>>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf into the object. Read moreSource§fn poll_flush(
self: Pin<&mut &Handle<TcpStream>>,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut &Handle<TcpStream>>, _cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach
their destination. Read more
Source§impl AsyncWrite for &Handle<UnixStream>
impl AsyncWrite for &Handle<UnixStream>
Source§fn poll_write(
self: Pin<&mut &Handle<UnixStream>>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut &Handle<UnixStream>>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf into the object. Read moreSource§fn poll_flush(
self: Pin<&mut &Handle<UnixStream>>,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut &Handle<UnixStream>>, _cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach
their destination. Read more
Source§impl AsyncWrite for Handle<File>
impl AsyncWrite for Handle<File>
Source§fn poll_write(
self: Pin<&mut Handle<File>>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut Handle<File>>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf into the object. Read moreSource§fn poll_flush(
self: Pin<&mut Handle<File>>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut Handle<File>>, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach
their destination. Read more
Source§impl AsyncWrite for Handle<TcpStream>
impl AsyncWrite for Handle<TcpStream>
Source§fn poll_write(
self: Pin<&mut Handle<TcpStream>>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut Handle<TcpStream>>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf into the object. Read moreSource§fn poll_flush(
self: Pin<&mut Handle<TcpStream>>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut Handle<TcpStream>>, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach
their destination. Read more
Source§impl AsyncWrite for Handle<UnixStream>
impl AsyncWrite for Handle<UnixStream>
Source§fn poll_write(
self: Pin<&mut Handle<UnixStream>>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut Handle<UnixStream>>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf into the object. Read moreSource§fn poll_flush(
self: Pin<&mut Handle<UnixStream>>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut Handle<UnixStream>>, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach
their destination. Read more
Source§impl<T> HandleOpRegisterer for &Handle<T>
impl<T> HandleOpRegisterer for &Handle<T>
Source§impl<T> HandleOpRegisterer for Handle<T>
impl<T> HandleOpRegisterer for Handle<T>
Source§impl<T> IntoRawFd for Handle<T>where
T: IntoRawFd,
impl<T> IntoRawFd for Handle<T>where
T: IntoRawFd,
Source§fn into_raw_fd(self) -> i32
fn into_raw_fd(self) -> i32
Consumes this object, returning the raw underlying file descriptor. Read more
impl<T> Send for Handle<T>
impl<T> Sync for Handle<T>
Auto Trait Implementations§
impl<T> Freeze for Handle<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Handle<T>
impl<T> Unpin for Handle<T>where
T: Unpin,
impl<T> !UnwindSafe for Handle<T>
Blanket Implementations§
Source§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn chain<R>(self, next: R) -> Chain<Self, R>
fn chain<R>(self, next: R) -> Chain<Self, R>
Creates an adaptor which will chain this stream with another. Read more
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
Tries to read some bytes directly into the given
buf in asynchronous
manner, returning a future type. Read moreSource§fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectored<'a, Self>where
Self: Unpin,
fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectored<'a, Self>where
Self: Unpin,
Creates a future which will read from the
AsyncRead into bufs using vectored
IO operations. Read moreSource§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
Creates a future which will read exactly enough bytes to fill
buf,
returning an error if end of file (EOF) is hit sooner. Read moreSource§fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
Creates a future which will read all the bytes from this
AsyncRead. Read moreSource§fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToString<'a, Self>where
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToString<'a, Self>where
Self: Unpin,
Creates a future which will read all the bytes from this
AsyncRead. Read moreSource§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
Reads some bytes from the byte stream. Read more
Source§fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
Reads the exact number of bytes required to fill
buf. Read moreSource§fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
Creates an adapter which will read at most
limit bytes from it. Read moreSource§impl<S> AsyncSeekExt for S
impl<S> AsyncSeekExt for S
Source§impl<S> AsyncSeekExt for S
impl<S> AsyncSeekExt for S
Source§impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
Source§fn flush(&mut self) -> Flush<'_, Self>where
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self>where
Self: Unpin,
Creates a future which will entirely flush this
AsyncWrite. Read moreSource§fn close(&mut self) -> Close<'_, Self>where
Self: Unpin,
fn close(&mut self) -> Close<'_, Self>where
Self: Unpin,
Creates a future which will entirely close this
AsyncWrite.Source§fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self>where
Self: Unpin,
fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self>where
Self: Unpin,
Creates a future which will write bytes from
buf into the object. Read moreSource§fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectored<'a, Self>where
Self: Unpin,
fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectored<'a, Self>where
Self: Unpin,
Creates a future which will write bytes from
bufs into the object using vectored
IO operations. Read moreSource§impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
Source§fn write<'a>(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>where
Self: Unpin,
fn write<'a>(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>where
Self: Unpin,
Writes some bytes into the byte stream. Read more
Source§fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectoredFuture<'a, Self>where
Self: Unpin,
fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectoredFuture<'a, Self>where
Self: Unpin,
Source§fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self>where
Self: Unpin,
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self>where
Self: Unpin,
Writes an entire buffer into the byte stream. Read more
Source§fn flush(&mut self) -> FlushFuture<'_, Self>where
Self: Unpin,
fn flush(&mut self) -> FlushFuture<'_, Self>where
Self: Unpin,
Flushes the stream to ensure that all buffered contents reach their destination. Read more
Source§fn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + Send + 'a>>
fn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + Send + 'a>>
Boxes the writer and changes its type to
dyn AsyncWrite + Send + 'a. Read moreSource§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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReadExt for T
impl<T> ReadExt for T
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
Reads some bytes from the byte stream. Read more
Source§fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
Reads all bytes from the byte stream. Read more
Source§fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
Reads all bytes from the byte stream and appends them into a string. Read more
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
Reads the exact number of bytes required to fill
buf. Read moreSource§fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
Creates an adaptor which will read at most
limit bytes from it. Read moreSource§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Creates a “by reference” adaptor for this instance of
Read. Read moreSource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WriteExt for Twhere
T: AsyncWrite + ?Sized,
impl<T> WriteExt for Twhere
T: AsyncWrite + ?Sized,
Source§fn write<'a>(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>where
Self: Unpin,
fn write<'a>(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>where
Self: Unpin,
Writes some bytes into the byte stream. Read more
Source§fn flush(&mut self) -> FlushFuture<'_, Self>where
Self: Unpin,
fn flush(&mut self) -> FlushFuture<'_, Self>where
Self: Unpin,
Flushes the stream to ensure that all buffered contents reach their destination. Read more