Skip to main content

Module io

Module io 

Available on crate feature std only.

Modules§

peek
Protocol peeking: inspect the first bytes of an input without consuming them.
rewind
timeout

Structs§

AbortIo
Ends an I/O abortively: its peer sees a reset (a TCP RST, an HTTP/2 RST_STREAM, an HTTP/3 RESET_STREAM) instead of an orderly end of stream, and data not yet delivered may be discarded.
AbortableIo
An I/O wrapper that stops reading and writing once its Scope is aborted, and holds that scope for as long as it exists.
ArrayBuf
A fixed-size, inline (stack) owned read buffer, no heap allocation.
BlockCache
A ReadAt wrapper that keeps recently read blocks in memory.
BlockCacheConfig
Configuration of a BlockCache.
BridgeIo
A bidirectional bridge between two Io objects.
ChainReader
Reader that can be used to chain two readers together.
FileIdentity
Which file a path or handle names, and whether it changed.
HeapReader
Reader for reading from a heap-allocated bytes buffer.
LossyUtf8Reader
Incremental lossy UTF-8 adapter for asynchronous buffered byte streams.
PrefixedIo
a stream which has some data prefixed to be read first prior to any other reading.
ReadAtFiles
A regular file opened for ReadAt from many threads.
ReplayReader
Reader replaying a Bytes buffer, releasing it once fully consumed.
Slice
A sub-range view [begin, end) of an owned IoBuf, itself an IoBuf.
StackReader
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’s buf_len). Created by IoBufMut::uninit; recover the buffer with into_inner.

Enums§

BufSlot
An owned buffer slot
NoPeekEgress
The egress of a PeekIoProvider that has none.

Traits§

AsyncReadOwned
Read bytes into an owned buffer, returning the buffer with the result.
AsyncWriteOwned
Write bytes from an owned buffer, returning the buffer with the result.
Io
A generic transport of bytes is a type that implements AsyncRead, AsyncWrite and Send. This is specific to Rama and is directly linked to the supertraits of Tokio.
IoBuf
An owned, stable byte buffer that can back an IO read or write.
IoBufMut
An IoBuf that can also be written into (i.e. used as a read destination).
PeekIoProvider
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 n bytes from reader.
poll_read_limited
Poll reader once for at most limit bytes into the unfilled part of buf, and advance buf past the bytes read, returning their count.
shutdown_within
Shut writer down in order, bounded by the hard phase of scope and by grace.

Type Aliases§

BufResult
Result of an owned-buffer IO operation: the io::Result plus the buffer handed back to the caller (ownership round-trips through the operation).