Crate dsq_io

Crate dsq_io 

Source
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§

file_writer
memory_writer
options
traits

Structs§

WriteOptions
Options for writing data

Enums§

CompressionLevel
Compression levels for output formats
DataFormat
Supported data formats for reading and writing
Error
I/O error type
FormatWriteOptions
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