3 stable releases
Uses new Rust 2024
| 2.0.1 | Nov 3, 2025 |
|---|---|
| 2.0.0 | Oct 8, 2025 |
| 1.0.0 | Sep 1, 2025 |
#617 in Asynchronous
115,787 downloads per month
Used in 34 crates
(8 directly)
81KB
1K
SLoC
reqsign-file-read-tokio
Tokio-based file reading implementation for reqsign.
This crate provides TokioFileRead, an async file reader that implements the FileRead trait from reqsign_core using Tokio's file system operations.
Quick Start
use reqsign_core::Context;
use reqsign_file_read_tokio::TokioFileRead;
// Create a context with Tokio file reader
let ctx = Context::new(
TokioFileRead::default(),
http_client, // Your HTTP client
);
// Read files asynchronously
let content = ctx.file_read("/path/to/file").await?;
Features
- Async File I/O: Leverages Tokio's async file system operations
- Zero Configuration: Works out of the box with sensible defaults
- Lightweight: Minimal dependencies, only what's needed
Use Cases
This crate is essential when:
- Loading credentials from file system (e.g.,
~/.aws/credentials) - Reading service account keys (e.g., Google Cloud service account JSON)
- Accessing configuration files for various cloud providers
Examples
Reading Credentials
Check out the read_credentials example to see how to read credential files:
cargo run --example read_credentials -- ~/.aws/credentials
Integration with Services
use reqsign_core::{Context, Signer};
use reqsign_file_read_tokio::TokioFileRead;
use reqsign_http_send_reqwest::ReqwestHttpSend;
// Create context with Tokio file reader
let ctx = Context::new(
TokioFileRead::default(),
ReqwestHttpSend::default(),
);
// Use with any service that needs file access
let signer = Signer::new(ctx, loader, builder);
Requirements
- Tokio runtime with
fsfeature enabled - Compatible with all reqsign service implementations
License
Licensed under Apache License, Version 2.0.
Dependencies
~5.5–9MB
~152K SLoC