Struct DownloadAuthorizationRequestBuilder

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

A builder to create a DownloadAuthorizationRequest.

After building the DownloadAuthorizationRequest, pass it to get_download_authorization to obtain a DownloadAuthorization

The bucket ID, file name prefix, and valid duration are required.

See https://www.backblaze.com/b2/docs/b2_get_download_authorization.html for furter information.

Implementations§

Source§

impl<'a> DownloadAuthorizationRequestBuilder<'a>

Source

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

Create a download authorization for the specified bucket ID.

Source

pub fn file_name_prefix( self, name: &'a str, ) -> Result<Self, FileNameValidationError>

Use the given file name prefix to determine what files the DownloadAuthorization will allow access to.

Source

pub fn duration(self, dur: Duration) -> Result<Self, ValidationError>

Specify the amount of time for which the DownloadAuthorization will be valid.

This must be between one second and one week, inclusive.

Source

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

If specified, download requests must have this content disposition. The grammar is specified in RFC 6266, except that parameter names containing a ‘*’ are not allowed.

Source

pub fn content_language<S: Into<String>>(self, lang: S) -> Self

If specified, download requests must have this content language. The grammar is specified in RFC 2616.

Source

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

If specified, download requests must have this expiration.

Source

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

If specified, download requests must have this cache control.

Source

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

If specified, download requests must have this content encoding.

Source

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

If specified, download requests must have this content type.

Source

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

Trait Implementations§

Source§

impl<'a> Default for DownloadAuthorizationRequestBuilder<'a>

Source§

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