1#![forbid(unsafe_code)]
3
4#[macro_use]
5extern crate serde_derive;
6
7use std::sync::atomic::AtomicU8;
8
9pub use awscreds as creds;
10pub use awsregion as region;
11
12pub use bucket::Bucket;
13pub use bucket::Tag;
14pub use bucket_ops::BucketConfiguration;
15pub use post_policy::{PostPolicy, PostPolicyChecksum, PostPolicyField, PostPolicyValue};
16pub use put_object_request::PutObjectRequest;
17#[cfg(any(feature = "with-tokio", feature = "with-async-std"))]
18pub use put_object_request::PutObjectStreamRequest;
19pub use region::Region;
20
21pub mod bucket;
22pub mod bucket_ops;
23pub mod command;
24pub mod deserializer;
25pub mod post_policy;
26pub mod put_object_request;
27pub mod serde_types;
28pub mod signing;
29
30pub mod error;
31pub mod request;
32pub mod utils;
33
34const LONG_DATETIME: &[time::format_description::FormatItem<'static>] =
35 time::macros::format_description!("[year][month][day]T[hour][minute][second]Z");
36const EMPTY_PAYLOAD_SHA: &str = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
37
38static RETRIES: AtomicU8 = AtomicU8::new(1);
39
40pub fn set_retries(retries: u8) {
55 RETRIES.store(retries, std::sync::atomic::Ordering::SeqCst);
56}
57
58pub fn get_retries() -> u8 {
73 RETRIES.load(std::sync::atomic::Ordering::Relaxed)
74}