use serde::Deserialize; /// Configuration for a bucket. /// /// This struct defines how a bucket should be configured, including its type. #[derive(Default, Deserialize)] pub struct BucketConfig { /// The type of the bucket, e.g., client bucket or normal bucket. /// /// When deserializing from TOML, this is expected to be under the key `"type"`. #[serde(rename = "type")] pub bucket_type: BucketType, } /// Enum for bucket types, used to distinguish different types of buckets. /// /// When deserializing, field names are mapped to string values in TOML via `serde(rename)`. #[derive(Default, Deserialize)] pub enum BucketType { /// Client bucket /// Uses local ID, mapped to remote ID via IDMAP #[serde(rename = "client")] ClientBucket, /// Normal bucket /// Uses global ID #[default] #[serde(rename = "bucket")] Bucket, }