![Latest Version] ![Documentation] ![License]
High level synchronous S3 Rust client library.
This client wraps Rusoto S3 and provides the following features:
ensure
crate for putting and deleting objects.```rust use s3_sync::{S3, Region, ObjectBodyMeta, Object, Bucket}; use std::io::Cursor; use std::io::Read;
let testbucket = std::env::var("S3TESTBUCKET").expect("S3TESTBUCKET not set"); let testkey = "foobar.test";
let s3 = S3::new(Region::default());
let bucket = s3.checkbucketexists(Bucket::fromname(testbucket)).expect("check if bucket exists").left().expect("bucket does not exist"); let object = Object::fromkey(&bucket, testkey.to_owned());
let body = Cursor::new(b"hello world".tovec()); let object = s3.putobject(object, body, ObjectBodyMeta::default()).unwrap();
let mut body = Vec::new(); s3.getbody(&object).expect("object body").readto_end(&mut body).unwrap();
assert_eq!(&body, b"hello world"); ```