Module smol::io

source · []
Expand description

Tools and combinators for I/O.

Examples

use futures_lite::io::{self, AsyncReadExt};

let input: &[u8] = b"hello";
let mut reader = io::BufReader::new(input);

let mut contents = String::new();
reader.read_to_string(&mut contents).await?;

Structs

Asserts that a type implementing std::io traits can be used as an async type.

Blocks on all async I/O operations and implements std::io traits.

Adds buffering to a reader.

Adds buffering to a writer.

Reader for the AsyncReadExt::bytes() method.

Reader for the AsyncReadExt::chain() method.

Future for the AsyncWriteExt::close() method.

Gives an in-memory buffer a cursor for reading and writing.

Reader for the empty() function.

The error type for I/O operations of the Read, Write, Seek, and associated traits.

Future for the AsyncBufReadExt::fill_buf() method.

Future for the AsyncWriteExt::flush() method.

Stream for the AsyncBufReadExt::lines() method.

Future for the AsyncReadExt::read() method.

The read half returned by split().

Reader for the repeat() function.

Future for the AsyncSeekExt::seek() method.

Writer for the sink() function.

Stream for the AsyncBufReadExt::split() method.

Reader for the AsyncReadExt::take() method.

Future for the AsyncWriteExt::write() method.

The write half returned by split().

Enums

A list specifying general categories of I/O error.

Enumeration of possible methods to seek within an I/O object.

Traits

Read bytes asynchronously.

Extension trait for AsyncBufRead.

Read bytes asynchronously.

Extension trait for AsyncRead.

Seek bytes asynchronously.

Extension trait for AsyncSeek.

Write bytes asynchronously.

Extension trait for AsyncWrite.

Functions

Copies the entire contents of a reader into a writer.

Creates an empty reader.

Creates an infinite reader that reads the same byte repeatedly.

Creates a writer that consumes and drops all data.

Splits a stream into AsyncRead and AsyncWrite halves.

Type Definitions

Type alias for Pin<Box<dyn AsyncRead + Send + 'static>>.

Type alias for Pin<Box<dyn AsyncWrite + Send + 'static>>.

A specialized Result type for I/O operations.