multibucket 0.1.0

A unified async object-storage trait with a from-scratch Qiniu Kodo backend (upload / download / delete / stat / list / signed URLs).
Documentation
//! # multibucket
//!
//! A small, async, backend-agnostic object-storage facade. Application code is
//! written once against the [`ObjectStorage`] trait and can be pointed at any
//! bucket — the "multi-bucket" idea. The first (and currently only) backend is
//! **Qiniu Kodo (七牛云对象存储)**, implemented from the raw HTTP API so the
//! crate pulls in almost no heavyweight dependencies.
//!
//! ## Quick start
//!
//! ```no_run
//! use std::time::Duration;
//! use bytes::Bytes;
//! use multibucket::{ObjectStorage, PutBody, PutOptions, backends::qiniu::{QiniuClient, QiniuConfig, Region}};
//!
//! # async fn run() -> multibucket::Result<()> {
//! let cfg = QiniuConfig::new("AK", "SK", "my-bucket").region(Region::Z0);
//! let client = QiniuClient::new(cfg);
//!
//! // Upload.
//! client.put("docs/readme.txt", PutBody::from(Bytes::from("hello")), &PutOptions::default()).await?;
//!
//! // Download.
//! let data = client.get("docs/readme.txt").await?;
//!
//! // Metadata / existence / delete.
//! let _meta = client.stat("docs/readme.txt").await?;
//! assert!(client.exists("docs/readme.txt").await?);
//! client.delete("docs/readme.txt").await?;
//!
//! // Time-limited download URL (signed automatically for private buckets).
//! let url = client.presign_get("docs/readme.txt", Duration::from_secs(600))?;
//! # Ok(())
//! # }
//! ```
//!
//! ## Backends
//!
//! * [`backends::qiniu`] — Qiniu Kodo. See [`QiniuClient`](backends::qiniu::QiniuClient).
//!
//! ## Feature notes
//!
//! * Signing (upload token / private download / `QBox` management) follows the
//!   official Qiniu algorithm docs and is implemented in
//!   [`backends::qiniu::Mac`].
//! * Large files can be uploaded with the resumable / multipart API
//!   ([`ObjectStorage::put_resumable`]); the Qiniu backend exposes the
//!   lower-level [`MultipartUpload`](backends::qiniu::MultipartUpload) handle
//!   and [`ResumeState`](backends::qiniu::ResumeState) for cross-restart resume.
//! * TLS uses `rustls` (no OpenSSL needed), so it builds cleanly on Windows.
//! * All uploads/downloads go through a single reusable `reqwest::Client`; pass
//!   your own via [`QiniuClient::with_http`](backends::qiniu::QiniuClient::with_http)
//!   to control timeouts and proxies.

#![warn(missing_docs)]
#![warn(rust_2018_idioms)]

pub mod backends;
mod error;
mod storage;
mod types;

pub use error::{Error, Result};
pub use storage::{ListOptions, ObjectStorage};
pub use types::{ListOutcome, ObjectMetadata, PutBody, PutOptions};