remi_s3/lib.rs
1// ๐ปโโ๏ธ๐งถ remi-rs: Asynchronous Rust crate to handle communication between applications and object storage providers
2// Copyright (c) 2022-2025 Noelware, LLC. <team@noelware.org>
3//
4// Permission is hereby granted, free of charge, to any person obtaining a copy
5// of this software and associated documentation files (the "Software"), to deal
6// in the Software without restriction, including without limitation the rights
7// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8// copies of the Software, and to permit persons to whom the Software is
9// furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in all
12// copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20// SOFTWARE.
21
22//! # ๐ปโโ๏ธ๐งถ `remi_s3`
23//! The **remi_s3** crate is an official implementation of the [`remi::StorageService`]
24//! trait with Amazon S3 using the official AWS crate [`aws_sdk_s3`].
25//!
26//! [`remi::StorageSerive`]: https://docs.rs/remi/*/remi/trait.StorageService.html
27//! [`aws_sdk_s3`]: https://docs.rs/aws-sdk-s3
28//!
29//! ## Example
30//! ```rust,no_run
31//! // Cargo.toml:
32//! //
33//! // [dependencies]
34//! // remi = "^0"
35//! // remi-s3 = { version = "^0", features = ["export-crates"] }
36//! // tokio = { version = "^1", features = ["full"] }
37//!
38//! use remi_s3::{StorageService, StorageConfig, aws::s3};
39//! use remi::{StorageService as _, UploadRequest};
40//!
41//! #[tokio::main]
42//! async fn main() {
43//! }
44//! ```
45//!
46//! ## Crate Features
47//! | Crate Features | Description | Enabled by default? |
48//! | :-------------- | :----------------------------------------------------------------------------------- | ------------------- |
49//! | `export-crates` | Exports all the used AWS crates as a module called `aws` | No. |
50//! | `unstable` | Tap into unstable features from `remi_gridfs` and the `remi` crate. | No. |
51//! | [`tracing`] | Enables the use of [`tracing::instrument`] and emit events for actions by the crate. | No. |
52//! | [`serde`] | Enables the use of **serde** in `StorageConfig` | No. |
53//! | [`log`] | Emits log records for actions by the crate | No. |
54//!
55//! [`tracing::instrument`]: https://docs.rs/tracing/*/tracing/attr.instrument.html
56//! [`tracing`]: https://crates.io/crates/tracing
57//! [`serde`]: https://serde.rs
58//! [`log`]: https://crates.io/crates/log
59
60#![doc(html_logo_url = "https://cdn.floofy.dev/images/trans.png")]
61#![doc(html_favicon_url = "https://cdn.floofy.dev/images/trans.png")]
62#![cfg_attr(any(noeldoc, docsrs), feature(doc_cfg))]
63
64mod config;
65mod error;
66mod service;
67
68pub use config::*;
69pub use error::*;
70pub use service::*;
71
72/// Exports the [`aws_sdk_s3`], [`aws_credential_types`], and [`aws_config`] crate without
73/// specifying the dependencies yourself.
74#[cfg(feature = "export-crates")]
75#[cfg_attr(any(noeldoc, docsrs), doc(cfg(feature = "export-crates")))]
76pub mod aws {
77 pub use aws_config as config;
78 pub use aws_credential_types as credential_types;
79 pub use aws_sdk_s3 as s3;
80}