pub struct S3ServiceState { /* private fields */ }Expand description
Top-level S3 service state holding all buckets.
Bucket names are globally unique across accounts, enforced by
global_bucket_owner. Per-account bucket data is stored in buckets.
All fields are accessed concurrently via DashMap; no external locking is
required.
Implementations§
Source§impl S3ServiceState
impl S3ServiceState
Sourcepub fn create_bucket(
&self,
name: String,
region: String,
owner: Owner,
) -> Result<(), S3ServiceError>
pub fn create_bucket( &self, name: String, region: String, owner: Owner, ) -> Result<(), S3ServiceError>
Create a new bucket.
§Errors
S3ServiceError::BucketAlreadyOwnedByYouif the caller already owns a bucket with the same name.S3ServiceError::BucketAlreadyExistsif the bucket name is taken by a different account.
Sourcepub fn delete_bucket(&self, name: &str) -> Result<(), S3ServiceError>
pub fn delete_bucket(&self, name: &str) -> Result<(), S3ServiceError>
Delete a bucket.
§Errors
S3ServiceError::NoSuchBucketif the bucket does not exist.S3ServiceError::BucketNotEmptyif the bucket still contains objects or in-progress multipart uploads.
Sourcepub fn get_bucket(
&self,
name: &str,
) -> Result<Ref<'_, String, S3Bucket>, S3ServiceError>
pub fn get_bucket( &self, name: &str, ) -> Result<Ref<'_, String, S3Bucket>, S3ServiceError>
Get an immutable reference to a bucket.
§Errors
Returns S3ServiceError::NoSuchBucket if the bucket does not exist.
Sourcepub fn get_bucket_mut(
&self,
name: &str,
) -> Result<RefMut<'_, String, S3Bucket>, S3ServiceError>
pub fn get_bucket_mut( &self, name: &str, ) -> Result<RefMut<'_, String, S3Bucket>, S3ServiceError>
Get a mutable reference to a bucket.
§Errors
Returns S3ServiceError::NoSuchBucket if the bucket does not exist.
Sourcepub fn list_buckets(&self) -> Vec<(String, DateTime<Utc>)>
pub fn list_buckets(&self) -> Vec<(String, DateTime<Utc>)>
List all buckets, returning (name, creation_date) pairs sorted by name.
Sourcepub fn bucket_exists(&self, name: &str) -> bool
pub fn bucket_exists(&self, name: &str) -> bool
Check whether a bucket exists.
Trait Implementations§
Source§impl Debug for S3ServiceState
impl Debug for S3ServiceState
Auto Trait Implementations§
impl Freeze for S3ServiceState
impl !RefUnwindSafe for S3ServiceState
impl Send for S3ServiceState
impl Sync for S3ServiceState
impl Unpin for S3ServiceState
impl UnsafeUnpin for S3ServiceState
impl UnwindSafe for S3ServiceState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more