Struct b2_client::file::DownloadFileBuilder
source · [−]pub struct DownloadFileBuilder<'a> { /* private fields */ }Implementations
sourceimpl<'a> DownloadFileBuilder<'a>
impl<'a> DownloadFileBuilder<'a>
sourcepub fn range(self, range: ByteRange) -> Self
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.
sourcepub fn content_disposition(
self,
disposition: &'a ContentDisposition
) -> Result<Self, ValidationError>
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.
sourcepub fn content_language(self, language: &'a str) -> Self
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.
sourcepub fn expiration(self, expiration: Expires) -> Self
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.
sourcepub fn cache_control(self, cache_control: CacheControl) -> Self
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.
sourcepub fn content_encoding(self, encoding: ContentEncoding) -> Self
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.
sourcepub fn content_type(self, content_type: impl Into<Mime>) -> Self
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.
sourcepub fn encryption_settings(self, settings: ServerSideEncryption) -> Self
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.
sourcepub fn build(self) -> Result<DownloadFile<'a>, ValidationError>
pub fn build(self) -> Result<DownloadFile<'a>, ValidationError>
Build a DownloadFile request.
Trait Implementations
sourceimpl<'a> Default for DownloadFileBuilder<'a>
impl<'a> Default for DownloadFileBuilder<'a>
sourcefn default() -> DownloadFileBuilder<'a>
fn default() -> DownloadFileBuilder<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for DownloadFileBuilder<'a>
impl<'a> Send for DownloadFileBuilder<'a>
impl<'a> Sync for DownloadFileBuilder<'a>
impl<'a> Unpin for DownloadFileBuilder<'a>
impl<'a> UnwindSafe for DownloadFileBuilder<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more