Struct s3compat::bucket::Bucket[][src]

pub struct Bucket {
    pub name: String,
    pub region: Region,
    pub credentials: Credentials,
    pub extra_headers: HeaderMap,
    pub extra_query: Query,
    // some fields omitted
}

Fields

name: Stringregion: Regioncredentials: Credentialsextra_headers: HeaderMapextra_query: Query

Implementations

impl Bucket[src]

pub fn presign_get<S: AsRef<str>>(
    &self,
    path: S,
    expiry_secs: u32
) -> Result<String>
[src]

pub fn presign_put<S: AsRef<str>>(
    &self,
    path: S,
    expiry_secs: u32,
    custom_headers: Option<HeaderMap>
) -> Result<String>
[src]

pub async fn create(
    name: &str,
    region: Region,
    credentials: Credentials,
    config: BucketConfiguration
) -> Result<CreateBucketResponse>
[src]

pub async fn create_with_path_style(
    name: &str,
    region: Region,
    credentials: Credentials,
    config: BucketConfiguration
) -> Result<CreateBucketResponse>
[src]

pub async fn delete(&self) -> Result<u16>[src]

pub fn new(
    name: &str,
    region: Region,
    credentials: Credentials
) -> Result<Bucket>
[src]

pub fn new_public(name: &str, region: Region) -> Result<Bucket>[src]

pub fn new_with_path_style(
    name: &str,
    region: Region,
    credentials: Credentials
) -> Result<Bucket>
[src]

pub fn new_public_with_path_style(name: &str, region: Region) -> Result<Bucket>[src]

pub async fn get_object<S: AsRef<str>>(&self, path: S) -> Result<(Vec<u8>, u16)>[src]

pub async fn get_object_torrent<S: AsRef<str>>(
    &self,
    path: S
) -> Result<(Vec<u8>, u16)>
[src]

pub async fn get_object_range<S: AsRef<str>>(
    &self,
    path: S,
    start: u64,
    end: Option<u64>
) -> Result<(Vec<u8>, u16)>
[src]

pub async fn get_object_stream<T: Write + Send, S: AsRef<str>>(
    &self,
    path: S,
    writer: &mut T
) -> Result<u16>
[src]

pub async fn put_object_stream<R: AsyncRead + Unpin>(
    &self,
    reader: &mut R,
    s3_path: impl AsRef<str>
) -> Result<u16>
[src]

pub async fn location(&self) -> Result<(Region, u16)>[src]

pub async fn delete_object<S: AsRef<str>>(
    &self,
    path: S
) -> Result<(Vec<u8>, u16)>
[src]

pub async fn head_object<S: AsRef<str>>(
    &self,
    path: S
) -> Result<(HeadObjectResult, u16)>
[src]

pub async fn put_object_with_content_type<S: AsRef<str>>(
    &self,
    path: S,
    content: &[u8],
    content_type: &str
) -> Result<(Vec<u8>, u16)>
[src]

pub async fn put_object<S: AsRef<str>>(
    &self,
    path: S,
    content: &[u8]
) -> Result<(Vec<u8>, u16)>
[src]

pub async fn put_object_tagging<S: AsRef<str>>(
    &self,
    path: &str,
    tags: &[(S, S)]
) -> Result<(Vec<u8>, u16)>
[src]

pub async fn delete_object_tagging<S: AsRef<str>>(
    &self,
    path: S
) -> Result<(Vec<u8>, u16)>
[src]

pub async fn get_object_tagging<S: AsRef<str>>(
    &self,
    path: S
) -> Result<(Vec<Tag>, u16)>
[src]

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]

pub async fn list(
    &self,
    prefix: String,
    delimiter: Option<String>
) -> Result<Vec<ListBucketResult>>
[src]

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]

pub async fn list_multiparts_uploads(
    &self,
    prefix: Option<&str>,
    delimiter: Option<&str>
) -> Result<Vec<ListMultipartUploadsResult>>
[src]

pub async fn abort_upload(&self, key: &str, upload_id: &str) -> Result<()>[src]

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]

fn clone(&self) -> Bucket[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Bucket[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl PartialEq<Bucket> for Bucket[src]

fn eq(&self, other: &Bucket) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Bucket) -> bool[src]

This method tests for !=.

impl Eq 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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

pub fn equivalent(&self, key: &K) -> bool[src]

Compare self to key and return true if they are equal.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

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]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V