diff --git a/aws_sigv4/Cargo.toml b/aws_sigv4/Cargo.toml index 131999b..d8d2d78 100644 --- a/aws_sigv4/Cargo.toml +++ b/aws_sigv4/Cargo.toml @@ -2,6 +2,7 @@ name = "aws_sigv4" version = "0.1.0" edition = "2024" +authors = ["foreverpyrite , - ) -> Result<(), R2Error> { + ) -> crate::Result { // Payload (file data) let payload = std::fs::read(local_file_path)?; trace!( diff --git a/r2client/src/error.rs b/r2client/src/error.rs index 9438385..8b98437 100644 --- a/r2client/src/error.rs +++ b/r2client/src/error.rs @@ -13,3 +13,5 @@ pub enum R2Error { #[error("Request failed during operation {0}: {1}\n{2}")] FailedRequest(String, http::StatusCode, String), } + +pub type Result = std::result::Result<(), R2Error>; diff --git a/r2client/src/lib.rs b/r2client/src/lib.rs index e2c4068..9b17bb2 100644 --- a/r2client/src/lib.rs +++ b/r2client/src/lib.rs @@ -1,6 +1,8 @@ mod error; mod mimetypes; -pub use error::R2Error; +// Should r2client::Result be r2client::R2Result just in case someone does a glob import or +// something? Or should that be left to the user of the library to use the "as" keyword? +pub use error::{R2Error, Result}; mod _async; #[cfg(feature = "async")] diff --git a/r2client/todo.md b/r2client/todo.md index 929560f..4759523 100644 --- a/r2client/todo.md +++ b/r2client/todo.md @@ -4,6 +4,7 @@ - [ ] A way to view the file contents (UTF-8 valid) would be cool - [ ] Add functions that will list files with their metadata (perhaps a simple R2File type?) - [ ] Clear out all all print statements and consider logging (this is a library, after all) + - [ ] How should buckets act in a multi-threaded environment if they are stored in an Arc or something? ## Dev (since we're so back): - [X] Update the sync library diff --git a/r2python/Cargo.toml b/r2python/Cargo.toml index 9865147..306cf66 100644 --- a/r2python/Cargo.toml +++ b/r2python/Cargo.toml @@ -2,6 +2,7 @@ name = "r2python" version = "0.1.0" edition = "2024" +authors = ["foreverpyrite