Struct DownloadFileBuilder

Source
pub struct DownloadFileBuilder<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> DownloadFileBuilder<'a>

Source

pub fn file_name(self, name: &str, bucket: &'a str) -> Self

Download a file with the specified file name.

The name will be percent-encoded.

If both file_name and file_id are provided, the last one will be used.

Source

pub fn file_id(self, id: &'a str) -> Self

Download a file with the specified file ID.

If both file_name and file_id are provided, the last one will be used.

Source

pub fn range(self, range: ByteRange) -> Self

Specify the byte range of the file to download.

There will be a Content-Range header that specifies the bytes returned and the total number of bytes.

The HTTP status code when a partial file is returned is 206 Partial Content rather than 200 OK.

Source

pub fn content_disposition( self, disposition: &'a ContentDisposition, ) -> Result<Self, ValidationError>

Override the Content-Disposition header of the response with the one provided.

If including this header will exceed the 7,000 byte header limit (2,048 bytes if using server-side encryption), the request will be rejected.

Source

pub fn content_language(self, language: &'a str) -> Self

Override the Content-Language header of the response with the one provided.

If including this header will exceed the 7,000 byte header limit (2,048 bytes if using server-side encryption), the request will be rejected.

Source

pub fn expiration(self, expiration: Expires) -> Self

Override the Expires header of the response with the one provided.

If including this header will exceed the 7,000 byte header limit (2,048 bytes if using server-side encryption), the request will be rejected.

Source

pub fn cache_control(self, cache_control: CacheControl) -> Self

Override the Cache-Control header of the response with the one provided.

If including this header will exceed the 7,000 byte header limit (2,048 bytes if using server-side encryption), the request will be rejected.

Source

pub fn content_encoding(self, encoding: ContentEncoding) -> Self

Override the Content-Encoding header of the response with the one provided.

If including this header will exceed the 7,000 byte header limit (2,048 bytes if using server-side encryption), the request will be rejected.

Source

pub fn content_type(self, content_type: impl Into<Mime>) -> Self

Override the Content-Type header of the response with the one provided.

If including this header will exceed the 7,000 byte header limit (2,048 bytes if using server-side encryption), the request will be rejected.

Source

pub fn encryption_settings(self, settings: ServerSideEncryption) -> Self

Set the encryption settings to use for the file.

This is required if using self-managed server-side encryption.

Source

pub fn build(self) -> Result<DownloadFile<'a>, ValidationError>

Build a DownloadFile request.

Trait Implementations§

Source§

impl<'a> Default for DownloadFileBuilder<'a>

Source§

fn default() -> DownloadFileBuilder<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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, 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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,