Module io
Available on crate feature
std only.Modules§
Structs§
- AbortIo
- Ends an I/O abortively: its peer sees a reset (a TCP RST, an HTTP/2
RST_STREAM, an HTTP/3RESET_STREAM) instead of an orderly end of stream, and data not yet delivered may be discarded. - Abortable
Io - An I/O wrapper that stops reading and writing once its
Scopeis aborted, and holds that scope for as long as it exists. - Array
Buf - A fixed-size, inline (stack) owned read buffer, no heap allocation.
- Block
Cache - A
ReadAtwrapper that keeps recently read blocks in memory. - Block
Cache Config - Configuration of a
BlockCache. - Bridge
Io - A bidirectional bridge between two
Ioobjects. - Chain
Reader - Reader that can be used to chain two readers together.
- File
Identity - Which file a path or handle names, and whether it changed.
- Heap
Reader - Reader for reading from a heap-allocated bytes buffer.
- Lossy
Utf8 Reader - Incremental lossy UTF-8 adapter for asynchronous buffered byte streams.
- Prefixed
Io - a stream which has some data prefixed to be read first prior to any other reading.
- Read
AtFiles - A regular file opened for
ReadAtfrom many threads. - Replay
Reader - Reader replaying a
Bytesbuffer, releasing it once fully consumed. - Slice
- A sub-range view
[begin, end)of an ownedIoBuf, itself anIoBuf. - Stack
Reader - Reader for reading from a stack buffer
- Uninit
- A read-target view of a buffer’s writable spare
[buf_len, capacity): reading into it appends to the underlying (the view’s offset 0 is the underlying’sbuf_len). Created byIoBufMut::uninit; recover the buffer withinto_inner.
Enums§
- BufSlot
- An owned buffer slot
- NoPeek
Egress - The egress of a
PeekIoProviderthat has none.
Traits§
- Async
Read Owned - Read bytes into an owned buffer, returning the buffer with the result.
- Async
Write Owned - Write bytes from an owned buffer, returning the buffer with the result.
- Io
- A generic transport of bytes is a type that implements
AsyncRead,AsyncWriteandSend. This is specific to Rama and is directly linked to the supertraits ofTokio. - IoBuf
- An owned, stable byte buffer that can back an IO read or write.
- IoBuf
Mut - An
IoBufthat can also be written into (i.e. used as a read destination). - Peek
IoProvider - A higher level trait that can be used by services which wish to peek into I/O, often as part of Deep Protocol Inspections (DPI).
- ReadAt
- Positional reads through
&self, safe to call from many threads at once. - SetLen
- Declare how many leading bytes of a buffer are initialized.
- SplitIo
- Split an IO into owned read and write halves usable concurrently.
Functions§
- discard
- Read and discard exactly
nbytes fromreader. - poll_
read_ limited - Poll
readeronce for at mostlimitbytes into the unfilled part ofbuf, and advancebufpast the bytes read, returning their count. - shutdown_
within - Shut
writerdown in order, bounded by the hard phase ofscopeand bygrace.
Type Aliases§
- BufResult
- Result of an owned-buffer IO operation: the
io::Resultplus the buffer handed back to the caller (ownership round-trips through the operation).