Skip to main content

S3RequestBuilder

Struct S3RequestBuilder 

Source
pub struct S3RequestBuilder<T: S3ResponseData> { /* private fields */ }
Expand description

Build and sign an s3 request

Implementations§

Source§

impl<T> S3RequestBuilder<T>
where T: S3ResponseData,

Source

pub fn new( method: Method, action: &str, access_key: &str, secret_key: &str, region: &str, endpoint: &str, ) -> Self

Create a new S3RequestBuilder

See crate::S3Client::new_request_builder

Source

pub fn method(&mut self, method: Method) -> &mut Self

Source

pub fn action(&mut self, action: &str) -> &mut Self

Source

pub fn query(&mut self, key: &str, value: Option<&str>) -> &mut Self

Add a query string

Source

pub fn header(&mut self, key: &str, value: &str) -> &mut Self

Add a header

Source

pub fn headers(&mut self, headers: Vec<(String, String)>) -> &mut Self

Add a headers

Source

pub fn body<B>(&mut self, body: B) -> &mut Self
where B: AsRef<[u8]>,

Set the request body

Source

pub fn scheme(&mut self, scheme: Scheme) -> &mut Self

Set request scheme

Source

pub fn set_content_headers(&mut self, content: &ContentHeaders) -> &mut Self

Set the request content headers

see ContentHeaders S3RequestBuilder::headers can be easier if adding a small amount of headers

Source

pub fn set_content_query(&mut self, content: &ContentHeaders) -> &mut Self

Set the request content query string will also set the range header if set

see ContentHeaders S3RequestBuilder::query can be easier if adding a small amount of queries

Source

pub fn set_conditional_headers( &mut self, conds: &ConditionalHeaders, ) -> &mut Self

Set the request conditional headers

see ConditionalHeaders S3RequestBuilder::headers can be easier if adding a small amount of headers

Source

pub fn set_x_amz_headers(&mut self, xamz: &XAmzHeaders) -> &mut Self

Set the request x-amz headers

See XAmzHeaders and x_amz_headers::XAmzHeadersBuilder S3RequestBuilder::headers can be easier if adding a small amount of headers

Source

pub fn set_auth( &mut self, access_key: &str, secret_key: &str, region: &str, endpoint: &str, ) -> &mut Self

Set authentication values

Source

pub fn build(&mut self) -> Result<S3Request<T>>

Build and sign the request

Auto Trait Implementations§

§

impl<T> Freeze for S3RequestBuilder<T>

§

impl<T> RefUnwindSafe for S3RequestBuilder<T>
where T: RefUnwindSafe,

§

impl<T> Send for S3RequestBuilder<T>
where T: Send,

§

impl<T> Sync for S3RequestBuilder<T>
where T: Sync,

§

impl<T> Unpin for S3RequestBuilder<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for S3RequestBuilder<T>

§

impl<T> UnwindSafe for S3RequestBuilder<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.