Struct s3::bucket::Bucket [−][src]
Instantiate an existing Bucket
Example
use s3::bucket::Bucket; use s3::creds::Credentials; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse().unwrap(); let credentials = Credentials::default().unwrap(); let bucket = Bucket::new(bucket_name, region, credentials);
Fields
name: String
region: Region
credentials: Credentials
extra_headers: HeaderMap
extra_query: Query
Implementations
impl Bucket
[src]
pub fn presign_get<S: AsRef<str>>(
&self,
path: S,
expiry_secs: u32
) -> Result<String>
[src]
&self,
path: S,
expiry_secs: u32
) -> Result<String>
Get a presigned url for getting object on a given path
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse().unwrap(); let credentials = Credentials::default().unwrap(); let bucket = Bucket::new(bucket_name, region, credentials).unwrap(); let url = bucket.presign_get("/test.file", 86400).unwrap(); println!("Presigned url: {}", url);
pub fn presign_put<S: AsRef<str>>(
&self,
path: S,
expiry_secs: u32,
custom_headers: Option<HeaderMap>
) -> Result<String>
[src]
&self,
path: S,
expiry_secs: u32,
custom_headers: Option<HeaderMap>
) -> Result<String>
Get a presigned url for putting object to a given path
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use http::HeaderMap; use http::header::HeaderName; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse().unwrap(); let credentials = Credentials::default().unwrap(); let bucket = Bucket::new(bucket_name, region, credentials).unwrap(); // Add optional custom headers let mut custom_headers = HeaderMap::new(); custom_headers.insert( HeaderName::from_static("custom_header"), "custom_value".parse().unwrap(), ); let url = bucket.presign_put("/test.file", 86400, Some(custom_headers)).unwrap(); println!("Presigned url: {}", url);
pub async fn create(
name: &str,
region: Region,
credentials: Credentials,
config: BucketConfiguration
) -> Result<CreateBucketResponse>
[src]
name: &str,
region: Region,
credentials: Credentials,
config: BucketConfiguration
) -> Result<CreateBucketResponse>
Create a new Bucket
and instantiate it
use s3::{Bucket, BucketConfiguration}; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let config = BucketConfiguration::default(); // Async variant with `tokio` or `async-std` features let create_bucket_response = Bucket::create(bucket_name, region, credentials, config).await?; // `sync` fature will produce an identical method #[cfg(feature = "sync")] let create_bucket_response = Bucket::create(bucket_name, region, credentials, config)?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let create_bucket_response = Bucket::create_blocking(bucket_name, region, credentials, config)?;
pub async fn create_with_path_style(
name: &str,
region: Region,
credentials: Credentials,
config: BucketConfiguration
) -> Result<CreateBucketResponse>
[src]
name: &str,
region: Region,
credentials: Credentials,
config: BucketConfiguration
) -> Result<CreateBucketResponse>
Create a new Bucket
with path style and instantiate it
use s3::{Bucket, BucketConfiguration}; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let config = BucketConfiguration::default(); // Async variant with `tokio` or `async-std` features let create_bucket_response = Bucket::create_with_path_style(bucket_name, region, credentials, config).await?; // `sync` fature will produce an identical method #[cfg(feature = "sync")] let create_bucket_response = Bucket::create_with_path_style(bucket_name, region, credentials, config)?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let create_bucket_response = Bucket::create_with_path_style_blocking(bucket_name, region, credentials, config)?;
pub async fn delete(&self) -> Result<u16>
[src]
Delete existing Bucket
Example
use s3::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse().unwrap(); let credentials = Credentials::default().unwrap(); let bucket = Bucket::new(bucket_name, region, credentials).unwrap(); // Async variant with `tokio` or `async-std` features bucket.delete().await.unwrap(); // `sync` fature will produce an identical method #[cfg(feature = "sync")] bucket.delete().unwrap(); // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] bucket.delete_blocking().unwrap();
pub fn new(
name: &str,
region: Region,
credentials: Credentials
) -> Result<Bucket>
[src]
name: &str,
region: Region,
credentials: Credentials
) -> Result<Bucket>
Instantiate an existing Bucket
.
Example
use s3::bucket::Bucket; use s3::creds::Credentials; // Fake credentials so we don't access user's real credentials in tests let bucket_name = "rust-s3-test"; let region = "us-east-1".parse().unwrap(); let credentials = Credentials::default().unwrap(); let bucket = Bucket::new(bucket_name, region, credentials).unwrap();
pub fn new_public(name: &str, region: Region) -> Result<Bucket>
[src]
Instantiate a public existing Bucket
.
Example
use s3::bucket::Bucket; use s3::creds::Credentials; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse().unwrap(); let bucket = Bucket::new_public(bucket_name, region).unwrap();
pub fn new_with_path_style(
name: &str,
region: Region,
credentials: Credentials
) -> Result<Bucket>
[src]
name: &str,
region: Region,
credentials: Credentials
) -> Result<Bucket>
Instantiate an existing Bucket
with path style addressing. Useful for compatibility with some storage APIs, like MinIO.
Example
use s3::bucket::Bucket; use s3::creds::Credentials; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse().unwrap(); let credentials = Credentials::default().unwrap(); let bucket = Bucket::new_with_path_style(bucket_name, region, credentials).unwrap();
pub fn new_public_with_path_style(name: &str, region: Region) -> Result<Bucket>
[src]
Instantiate a public existing Bucket
with path style addressing. Useful for compatibility with some storage APIs, like MinIO.
Example
use s3::bucket::Bucket; use s3::creds::Credentials; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse().unwrap(); let bucket = Bucket::new_public_with_path_style(bucket_name, region).unwrap();
pub async fn get_object<S: AsRef<str>>(&self, path: S) -> Result<(Vec<u8>, u16)>
[src]
Gets file from an S3 path.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let (data, code) = bucket.get_object("/test.file").await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (data, code) = bucket.get_object("/test.file")?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (data, code) = bucket.get_object_blocking("/test.file")?;
pub async fn get_object_torrent<S: AsRef<str>>(
&self,
path: S
) -> Result<(Vec<u8>, u16)>
[src]
&self,
path: S
) -> Result<(Vec<u8>, u16)>
Gets torrent from an S3 path.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let (data, code) = bucket.get_object_torrent("/test.file").await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (data, code) = bucket.get_object_torrent("/test.file")?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (data, code) = bucket.get_object_torrent_blocking("/test.file")?;
pub async fn get_object_range<S: AsRef<str>>(
&self,
path: S,
start: u64,
end: Option<u64>
) -> Result<(Vec<u8>, u16)>
[src]
&self,
path: S,
start: u64,
end: Option<u64>
) -> Result<(Vec<u8>, u16)>
Gets specified inclusive byte range of file from an S3 path.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let (data, code) = bucket.get_object_range("/test.file", 0, Some(31)).await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (data, code) = bucket.get_object_range("/test.file", 0, Some(31))?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (data, code) = bucket.get_object_range_blocking("/test.file", 0, Some(31))?;
pub async fn get_object_stream<T: Write + Send, S: AsRef<str>>(
&self,
path: S,
writer: &mut T
) -> Result<u16>
[src]
&self,
path: S,
writer: &mut T
) -> Result<u16>
Stream file from S3 path to a local file, generic over T: Write.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; use std::fs::File; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; let mut output_file = File::create("output_file").expect("Unable to create file"); // Async variant with `tokio` or `async-std` features let status_code = bucket.get_object_stream("/test.file", &mut output_file).await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let status_code = bucket.get_object_stream("/test.file", &mut output_file)?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let status_code = bucket.get_object_stream_blocking("/test.file", &mut output_file)?;
pub async fn put_object_stream<R: AsyncRead + Unpin>(
&self,
reader: &mut R,
s3_path: impl AsRef<str>
) -> Result<u16>
[src]
&self,
reader: &mut R,
s3_path: impl AsRef<str>
) -> Result<u16>
Stream file from local path to s3, generic over T: Write.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; use std::fs::File; use std::io::Write; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; let path = "path"; let test: Vec<u8> = (0..1000).map(|_| 42).collect(); let mut file = File::create(path)?; file.write_all(&test)?; #[cfg(feature = "with-tokio")] let mut path = tokio::fs::File::open(path).await?; #[cfg(feature = "with-async-std")] let mut path = async_std::fs::File::open(path).await?; // Async variant with `tokio` or `async-std` features // Generic over futures::io::AsyncRead|tokio::io::AsyncRead + Unpin let status_code = bucket.put_object_stream(&mut path, "/path").await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] // Generic over std::io::Read let status_code = bucket.put_object_stream(&mut path, "/path")?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let status_code = bucket.put_object_stream_blocking(&mut path, "/path")?;
pub async fn location(&self) -> Result<(Region, u16)>
[src]
Get Bucket location.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let (region, status_code) = bucket.location().await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (region, status_code) = bucket.location()?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (region, status_code) = bucket.location_blocking()?;
pub async fn delete_object<S: AsRef<str>>(
&self,
path: S
) -> Result<(Vec<u8>, u16)>
[src]
&self,
path: S
) -> Result<(Vec<u8>, u16)>
Delete file from an S3 path.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let (_, code) = bucket.delete_object("/test.file").await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (_, code) = bucket.delete_object("/test.file")?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (_, code) = bucket.delete_object_blocking("/test.file")?;
pub async fn head_object<S: AsRef<str>>(
&self,
path: S
) -> Result<(HeadObjectResult, u16)>
[src]
&self,
path: S
) -> Result<(HeadObjectResult, u16)>
Head object from S3.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let (head_object_result, code) = bucket.head_object("/test.png").await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (head_object_result, code) = bucket.head_object("/test.png")?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (head_object_result, code) = bucket.head_object_blocking("/test.png")?;
pub async fn put_object_with_content_type<S: AsRef<str>>(
&self,
path: S,
content: &[u8],
content_type: &str
) -> Result<(Vec<u8>, u16)>
[src]
&self,
path: S,
content: &[u8],
content_type: &str
) -> Result<(Vec<u8>, u16)>
Put into an S3 bucket, with explicit content-type.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; let content = "I want to go to S3".as_bytes(); // Async variant with `tokio` or `async-std` features let (_, code) = bucket.put_object_with_content_type("/test.file", content, "text/plain").await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (_, code) = bucket.put_object_with_content_type("/test.file", content, "text/plain")?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (_, code) = bucket.put_object_with_content_type_blocking("/test.file", content, "text/plain")?;
pub async fn put_object<S: AsRef<str>>(
&self,
path: S,
content: &[u8]
) -> Result<(Vec<u8>, u16)>
[src]
&self,
path: S,
content: &[u8]
) -> Result<(Vec<u8>, u16)>
Put into an S3 bucket.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; let content = "I want to go to S3".as_bytes(); // Async variant with `tokio` or `async-std` features let (_, code) = bucket.put_object("/test.file", content).await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (_, code) = bucket.put_object("/test.file", content)?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (_, code) = bucket.put_object_blocking("/test.file", content)?;
pub async fn put_object_tagging<S: AsRef<str>>(
&self,
path: &str,
tags: &[(S, S)]
) -> Result<(Vec<u8>, u16)>
[src]
&self,
path: &str,
tags: &[(S, S)]
) -> Result<(Vec<u8>, u16)>
Tag an S3 object.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let (_, code) = bucket.put_object_tagging("/test.file", &[("Tag1", "Value1"), ("Tag2", "Value2")]).await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (_, code) = bucket.put_object_tagging("/test.file", &[("Tag1", "Value1"), ("Tag2", "Value2")])?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (_, code) = bucket.put_object_tagging_blocking("/test.file", &[("Tag1", "Value1"), ("Tag2", "Value2")])?;
pub async fn delete_object_tagging<S: AsRef<str>>(
&self,
path: S
) -> Result<(Vec<u8>, u16)>
[src]
&self,
path: S
) -> Result<(Vec<u8>, u16)>
Delete tags from an S3 object.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let (_, code) = bucket.delete_object_tagging("/test.file").await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (_, code) = bucket.delete_object_tagging("/test.file")?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (_, code) = bucket.delete_object_tagging_blocking("/test.file")?;
pub async fn get_object_tagging<S: AsRef<str>>(
&self,
path: S
) -> Result<(Vec<Tag>, u16)>
[src]
&self,
path: S
) -> Result<(Vec<Tag>, u16)>
Retrieve an S3 object list of tags.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let (_, code) = bucket.get_object_tagging("/test.file").await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let (_, code) = bucket.get_object_tagging("/test.file")?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let (_, code) = bucket.get_object_tagging_blocking("/test.file")?;
pub async fn list_page(
&self,
prefix: String,
delimiter: Option<String>,
continuation_token: Option<String>,
start_after: Option<String>,
max_keys: Option<usize>
) -> Result<(ListBucketResult, u16)>
[src]
&self,
prefix: String,
delimiter: Option<String>,
continuation_token: Option<String>,
start_after: Option<String>,
max_keys: Option<usize>
) -> Result<(ListBucketResult, u16)>
pub async fn list(
&self,
prefix: String,
delimiter: Option<String>
) -> Result<Vec<ListBucketResult>>
[src]
&self,
prefix: String,
delimiter: Option<String>
) -> Result<Vec<ListBucketResult>>
List the contents of an S3 bucket.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let results = bucket.list("/".to_string(), Some("/".to_string())).await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let results = bucket.list("/".to_string(), Some("/".to_string()))?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let results = bucket.list_blocking("/".to_string(), Some("/".to_string()))?;
pub async fn list_multiparts_uploads_page(
&self,
prefix: Option<&str>,
delimiter: Option<&str>,
key_marker: Option<String>,
max_uploads: Option<usize>
) -> Result<(ListMultipartUploadsResult, u16)>
[src]
&self,
prefix: Option<&str>,
delimiter: Option<&str>,
key_marker: Option<String>,
max_uploads: Option<usize>
) -> Result<(ListMultipartUploadsResult, u16)>
pub async fn list_multiparts_uploads(
&self,
prefix: Option<&str>,
delimiter: Option<&str>
) -> Result<Vec<ListMultipartUploadsResult>>
[src]
&self,
prefix: Option<&str>,
delimiter: Option<&str>
) -> Result<Vec<ListMultipartUploadsResult>>
List the ongoing multipart uploads of an S3 bucket. This may be useful to cleanup failed
uploads, together with crate::bucket::Bucket::abort_upload
.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let results = bucket.list_multiparts_uploads(Some("/"), Some("/")).await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let results = bucket.list_multiparts_uploads(Some("/"), Some("/"))?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let results = bucket.list_multiparts_uploads_blocking(Some("/"), Some("/"))?;
pub async fn abort_upload(&self, key: &str, upload_id: &str) -> Result<()>
[src]
Abort a running multipart upload.
Example:
use s3::bucket::Bucket; use s3::creds::Credentials; use anyhow::Result; let bucket_name = "rust-s3-test"; let region = "us-east-1".parse()?; let credentials = Credentials::default()?; let bucket = Bucket::new(bucket_name, region, credentials)?; // Async variant with `tokio` or `async-std` features let results = bucket.abort_upload("/some/file.txt", "ZDFjM2I0YmEtMzU3ZC00OTQ1LTlkNGUtMTgxZThjYzIwNjA2").await?; // `sync` feature will produce an identical method #[cfg(feature = "sync")] let results = bucket.abort_upload("/some/file.txt", "ZDFjM2I0YmEtMzU3ZC00OTQ1LTlkNGUtMTgxZThjYzIwNjA2")?; // Blocking variant, generated with `blocking` feature in combination // with `tokio` or `async-std` features. #[cfg(feature = "blocking")] let results = bucket.abort_upload_blocking("/some/file.txt", "ZDFjM2I0YmEtMzU3ZC00OTQ1LTlkNGUtMTgxZThjYzIwNjA2")?;
pub fn is_path_style(&self) -> bool
[src]
Get path_style field of the Bucket struct
pub fn is_subdomain_style(&self) -> bool
[src]
pub fn set_path_style(&mut self)
[src]
Configure bucket to use path-style urls and headers
pub fn set_subdomain_style(&mut self)
[src]
Configure bucket to use subdomain style urls and headers [default]
pub fn name(&self) -> String
[src]
Get a reference to the name of the S3 bucket.
pub fn host(&self) -> String
[src]
pub fn url(&self) -> String
[src]
pub fn path_style_host(&self) -> String
[src]
Get a paths-style reference to the hostname of the S3 API endpoint.
pub fn subdomain_style_host(&self) -> String
[src]
pub fn scheme(&self) -> String
[src]
pub fn region(&self) -> Region
[src]
Get the region this object will connect to.
pub fn access_key(&self) -> Option<String>
[src]
Get a reference to the AWS access key.
pub fn secret_key(&self) -> Option<String>
[src]
Get a reference to the AWS secret key.
pub fn security_token(&self) -> Option<&str>
[src]
Get a reference to the AWS security token.
pub fn session_token(&self) -> Option<&str>
[src]
Get a reference to the AWS session token.
pub fn credentials(&self) -> &Credentials
[src]
Get a reference to the full Credentials
object used by this Bucket
.
pub fn set_credentials(&mut self, credentials: Credentials) -> Credentials
[src]
Change the credentials used by the Bucket, returning the existing credentials.
pub fn add_header(&mut self, key: &str, value: &str)
[src]
Add an extra header to send with requests to S3.
Add an extra header to send with requests. Note that the library already sets a number of headers - headers set with this method will be overridden by the library headers:
- Host
- Content-Type
- Date
- Content-Length
- Authorization
- X-Amz-Content-Sha256
- X-Amz-Date
pub fn extra_headers(&self) -> &HeaderMap
[src]
Get a reference to the extra headers to be passed to the S3 API.
pub fn extra_headers_mut(&mut self) -> &mut HeaderMap
[src]
Get a mutable reference to the extra headers to be passed to the S3 API.
pub fn add_query(&mut self, key: &str, value: &str)
[src]
Add an extra query pair to the URL used for S3 API access.
pub fn extra_query(&self) -> &Query
[src]
Get a reference to the extra query pairs to be passed to the S3 API.
pub fn extra_query_mut(&mut self) -> &mut Query
[src]
Get a mutable reference to the extra query pairs to be passed to the S3 API.
Trait Implementations
impl Clone for Bucket
[src]
impl Debug for Bucket
[src]
impl Eq for Bucket
[src]
impl PartialEq<Bucket> for Bucket
[src]
impl StructuralEq for Bucket
[src]
impl StructuralPartialEq for Bucket
[src]
Auto Trait Implementations
impl RefUnwindSafe for Bucket
impl Send for Bucket
impl Sync for Bucket
impl Unpin for Bucket
impl UnwindSafe for Bucket
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,