UpdateBucketBuilder

Struct UpdateBucketBuilder 

Source
pub struct UpdateBucketBuilder { /* private fields */ }
Expand description

A builder to create an UpdateBucket request.

Implementations§

Source§

impl UpdateBucketBuilder

Source

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

The ID of the bucket to update.

This is required.

Source

pub fn bucket_type(self, typ: BucketType) -> Result<Self, ValidationError>

Change the bucket’s type to the one provided.

Source

pub fn bucket_info(self, info: Value) -> Self

Replace the current bucket information with the specified information.

This can contain arbitrary metadata for your own use. You can also set cache-control settings from here (but see cache_control). If Cache-Control is set here and via the cache-control method, the latter will override this value.

Source

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

Set the default Cache-Control header value for files downloaded from the bucket.

Source

pub fn cors_rules( self, rules: impl Into<Vec<CorsRule>>, ) -> Result<Self, ValidationError>

Replace the bucket’s current provided CORS rules with the provided rules.

See https://www.backblaze.com/b2/docs/cors_rules.html for further information.

Source

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

Replace the bucket’s default retention policy.

The Authorization must have Capability::WriteBucketRetentions.

Source

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

Replace the bucket’s server-side encryption settings.

The Authorization must have Capability::WriteBucketEncryption.

Source

pub fn lifecycle_rules( self, rules: impl Into<Vec<LifecycleRule>>, ) -> Result<Self, LifecycleRuleValidationError>

Replace the bucket’s lifecycle rules with the provided list.

See the documentation for CreateBucketBuilder::lifecycle_rules for the lifecycle requirements and examples.

Source

pub fn if_revision_is(self, revision: u16) -> Self

Only perform the update if the bucket’s current revision is the provided version.

Source

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

Trait Implementations§

Source§

impl Default for UpdateBucketBuilder

Source§

fn default() -> UpdateBucketBuilder

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,