IO traits for completion-based async IO.
This crate provides async IO traits designed for completion-based operations. Unlike traditional poll-based async IO traits, these traits work with owned buffers and return both the buffer and the operation result upon completion.
The crate itself is runtime-agnostic and can be used with any completion-based async IO runtime.
Use compio::io re-exported from compio crate, then use the io traits in your application:
use compio::io::{AsyncRead, AsyncWrite};If you are writing libraries that want to support completion-based async IO, you can depend on this crate directly:
cargo add compio-ioThen you can use the io traits in your library:
use compio_io::{AsyncRead, AsyncWrite};AsyncRead: Async read into a buffer implementsIoBufMutAsyncReadAt: Async read into a buffer implementsIoBufMutwith offsetAsyncWrite: Async write from a buffer implementsIoBufAsyncWriteAt: Async write from a buffer implementsIoBufwith offset
AsyncBufRead: Trait of async read with buffered contentBufReader: An async reader with internal bufferBufWriter: An async writer with internal buffer
AsyncReadExt: Extension trait forAsyncReadAsyncReadAtExt: Extension trait forAsyncReadAtAsyncWriteExt: Extension trait forAsyncWriteAsyncWriteAtExt: Extension trait forAsyncWriteAt
framed::Framed: AdaptsAsyncReadtoStreamandAsyncWritetoSink, with framed en/decoding.compat::SyncStream: Adapts async IO to std blocking io (requirescompatfeature)compat::AsyncStream: Adapts async IO tofutures_util::iotraits (requirescompatfeature)
See docs.rs for detail: copy, null, repeat, split, split_unsync.