Expand description
dsq-io: Low-level I/O utilities for dsq
This crate provides basic functions for reading and writing bytes to/from files, STDIN, and STDOUT. It handles the low-level I/O operations without any format-specific logic.
§Features
- Synchronous and asynchronous I/O
- File reading/writing
- STDIN/STDOUT handling
- Network I/O (planned)
§Examples
Reading from a file:
ⓘ
use dsq_io::read_file;
let data = read_file("data.txt").await.unwrap();Writing to STDOUT:
ⓘ
use dsq_io::write_stdout;
write_stdout(b"Hello, world!").await.unwrap();Re-exports§
pub use file_writer::to_path;pub use file_writer::to_path_with_format;pub use file_writer::FileWriter;pub use memory_writer::to_memory;pub use memory_writer::MemoryWriter;pub use traits::DataWriter;
Modules§
Structs§
- Write
Options - Options for writing data
Enums§
- Compression
Level - Compression levels for output formats
- Data
Format - Supported data formats for reading and writing
- Error
- I/O error type
- Format
Write Options - Format-specific write options
Functions§
- read_
file - Read all bytes from a file asynchronously
- read_
file_ sync - Synchronous versions for compatibility Read all bytes from a file synchronously
- read_
stdin - Read all bytes from STDIN asynchronously
- read_
stdin_ sync - Read all bytes from STDIN synchronously
- serialize
- Serialize data to a writer based on format
- write_
file - Write bytes to a file asynchronously
- write_
file_ sync - Write bytes to a file synchronously
- write_
stderr - Write bytes to STDERR asynchronously
- write_
stderr_ sync - Write bytes to STDERR synchronously
- write_
stdout - Write bytes to STDOUT asynchronously
- write_
stdout_ sync - Write bytes to STDOUT synchronously
Type Aliases§
- Result
- Error type for I/O operations