s3uri: AWS S3 URIs in Rust
s3uri is a Rust library with structs and functions for building and parsing Amazon Web Services S3 URIs.
Installation
Examples
Parsing a URI
s3uri::from_uri parses a string URI and returns a s3uri::S3Uri struct with the bucket name and key set.
let uri = from_uri.unwrap;
assert_eq!;
assert_eq!;
Creating a new URI
To create a new URI from scratch, pass the bucket name to s3uri::from_bucket to get a s3uri::S3Uri struct.
let uri = from_bucket.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
Joining keys and key prefixes
Call s3uri::S3Uri::join() to build up the key. Slashes will be normalised and added between each segment as-needed.
let images_prefix = from_bucket
.unwrap
.join;
assert_eq!;
let clowns_uri = images_prefix
.join
.join;
assert_eq!;
Author
Hello! 👋 I'm Cariad Eccleston. You can find me at cariad.earth, github.com/cariad, linkedin.com/in/cariad and @cariad.earth on Bluesky.