Struct StartLargeFileBuilder

Source
pub struct StartLargeFileBuilder<'a> { /* private fields */ }
Expand description

A builder for a StartLargeFile request.

Implementations§

Source§

impl<'a> StartLargeFileBuilder<'a>

Source

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

Specify the bucket in which to store the new file.

Source

pub fn file_name( self, name: impl AsRef<str>, ) -> Result<Self, FileNameValidationError>

Set the file’s name.

The provided name will be percent-encoded.

Source

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

Set the file’s MIME type.

If not specified, B2 will attempt to determine the file’s type.

Source

pub fn file_info(self, info: Value) -> Result<Self, ValidationError>

Set file metadata to be returned in headers when downloading the file.

For the following headers, use their corresponding methods instead of setting the values here:

If any of the above are set here and via their methods, the value from the method will override the value specified here.

Source

pub fn file_retention(self, policy: FileRetentionPolicy) -> Self

Set the retention policy for the file.

Enable a legal hold on the file.

Disable a legal hold on the file.

Source

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

Set the server-side encryption configuration for the file.

Source

pub fn last_modified(self, time: DateTime<Utc>) -> Self

The time of the file’s last modification.

Source

pub fn sha1_checksum(self, checksum: &'a str) -> Self

The SHA1 checksum of the file’s contents.

B2 will use this to verify the accuracy of the file upload, and it will be returned in the header X-Bz-Content-Sha1 when downloading the file.

Source

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

The value to use for the Content-Disposition header when downloading the file.

Parameter continuations are not supported.

Note that the download request can override this value.

Source

pub fn content_language(self, language: impl Into<String>) -> Self

The value to use for the Content-Language header when downloading the file.

Note that the download request can override this value.

Source

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

The value to use for the Expires header when the file is downloaded.

Note that the download request can override this value.

Source

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

The value to use for the Cache-Control header when the file is downloaded.

This would override the value set at the bucket level, and can be overriden by a download request.

Source

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

The value to use for the Content-Encoding header when the file is downloaded.

Note that this can be overriden by a download request.

Source

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

Trait Implementations§

Source§

impl<'a> Debug for StartLargeFileBuilder<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for StartLargeFileBuilder<'a>

Source§

fn default() -> StartLargeFileBuilder<'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,