pub struct S3Bucket {Show 27 fields
pub name: String,
pub region: String,
pub creation_date: DateTime<Utc>,
pub owner: Owner,
pub objects: RwLock<ObjectStore>,
pub multipart_uploads: DashMap<String, MultipartUpload>,
pub versioning: RwLock<VersioningStatus>,
pub encryption: RwLock<Option<BucketEncryption>>,
pub cors_rules: RwLock<Option<Vec<CorsRuleConfig>>>,
pub lifecycle: RwLock<Option<BucketLifecycleConfiguration>>,
pub policy: RwLock<Option<String>>,
pub tags: RwLock<Vec<(String, String)>>,
pub acl: RwLock<CannedAcl>,
pub notification_configuration: RwLock<Option<NotificationConfiguration>>,
pub logging: RwLock<Option<Value>>,
pub public_access_block: RwLock<Option<PublicAccessBlockConfig>>,
pub ownership_controls: RwLock<Option<OwnershipControlsConfig>>,
pub object_lock_enabled: RwLock<bool>,
pub object_lock_configuration: RwLock<Option<ObjectLockConfiguration>>,
pub accelerate: RwLock<Option<String>>,
pub request_payment: RwLock<String>,
pub website: RwLock<Option<WebsiteConfig>>,
pub replication: RwLock<Option<Value>>,
pub analytics: RwLock<Option<Value>>,
pub metrics: RwLock<Option<Value>>,
pub inventory: RwLock<Option<Value>>,
pub intelligent_tiering: RwLock<Option<Value>>,
}Expand description
An S3 bucket with all its state and configuration.
Thread-safe: interior fields use parking_lot::RwLock for configuration
and objects, DashMap for multipart uploads.
Fields§
§name: StringBucket name.
region: StringAWS region where this bucket was created.
creation_date: DateTime<Utc>When the bucket was created.
owner: OwnerThe bucket owner.
objects: RwLock<ObjectStore>Object key storage (un-versioned or versioned).
multipart_uploads: DashMap<String, MultipartUpload>In-progress multipart uploads, keyed by upload ID.
versioning: RwLock<VersioningStatus>Bucket versioning status.
encryption: RwLock<Option<BucketEncryption>>Server-side encryption configuration.
cors_rules: RwLock<Option<Vec<CorsRuleConfig>>>CORS rules.
lifecycle: RwLock<Option<BucketLifecycleConfiguration>>Lifecycle configuration.
policy: RwLock<Option<String>>Bucket policy (JSON string).
Bucket tags.
acl: RwLock<CannedAcl>Canned ACL for the bucket.
notification_configuration: RwLock<Option<NotificationConfiguration>>Notification configuration for the bucket.
logging: RwLock<Option<Value>>Logging configuration (stored as opaque JSON).
public_access_block: RwLock<Option<PublicAccessBlockConfig>>Public access block settings.
ownership_controls: RwLock<Option<OwnershipControlsConfig>>Ownership controls.
object_lock_enabled: RwLock<bool>Whether Object Lock is enabled on this bucket.
object_lock_configuration: RwLock<Option<ObjectLockConfiguration>>Object Lock configuration (retention rules).
accelerate: RwLock<Option<String>>Transfer acceleration status (e.g. "Enabled", "Suspended").
request_payment: RwLock<String>Request payment configuration (default "BucketOwner").
website: RwLock<Option<WebsiteConfig>>Static website hosting configuration.
replication: RwLock<Option<Value>>Replication configuration (stored as opaque JSON).
analytics: RwLock<Option<Value>>Analytics configuration (stored as opaque JSON).
metrics: RwLock<Option<Value>>Metrics configuration (stored as opaque JSON).
inventory: RwLock<Option<Value>>Inventory configuration (stored as opaque JSON).
intelligent_tiering: RwLock<Option<Value>>Intelligent-Tiering configuration (stored as opaque JSON).
Implementations§
Source§impl S3Bucket
impl S3Bucket
Sourcepub fn new(name: String, region: String, owner: Owner) -> Self
pub fn new(name: String, region: String, owner: Owner) -> Self
Create a new bucket with the given name, region, and owner.
All configuration fields are initialized to their defaults.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the bucket contains zero objects (and no in-progress multipart uploads).
Sourcepub fn is_versioning_enabled(&self) -> bool
pub fn is_versioning_enabled(&self) -> bool
Whether versioning is currently enabled on this bucket.
Sourcepub fn enable_versioning(&self)
pub fn enable_versioning(&self)
Enable versioning on this bucket.
If the bucket is currently un-versioned, the object store is
transitioned to a super::keystore::VersionedKeyStore. If
versioning was suspended, it is simply re-enabled.
Sourcepub fn suspend_versioning(&self)
pub fn suspend_versioning(&self)
Suspend versioning on this bucket.
Objects already stored retain their version history. New puts will
receive a version ID of "null" (overwriting any existing "null"
version).