CosConfig

Struct CosConfig 

Source
pub struct CosConfig {
    pub provider: String,
    pub tencent: TencentCosConfig,
    pub aliyun: AliyunOssConfig,
    pub aws: AwsS3Config,
    pub minio: MinioConfig,
    pub huawei: HuaweiObsConfig,
    pub rustfs: RustFsConfig,
}
Expand description

对象存储配置

支持多种云存储服务商和本地文件系统

§字段说明

  • provider: 存储提供商,可选值:tencent/aliyun/aws/minio/huawei/rustfs
  • tencent: 腾讯云 COS 配置
  • aliyun: 阿里云 OSS 配置
  • aws: AWS S3 配置
  • minio: MinIO 配置
  • huawei: 华为云 OBS 配置
  • rustfs: 本地文件系统配置

§示例

use admin_config::CosConfig;

let config = CosConfig {
    provider: "tencent".to_string(),
    ..Default::default()
};

Fields§

§provider: String

对象存储提供商 (tencent/aliyun/aws/minio/huawei/rustfs)

§tencent: TencentCosConfig

腾讯云 COS 配置

§aliyun: AliyunOssConfig

阿里云 OSS 配置

§aws: AwsS3Config

AWS S3 配置

§minio: MinioConfig

MinIO 配置

§huawei: HuaweiObsConfig

华为云 OBS 配置

§rustfs: RustFsConfig

RustFS 本地文件系统配置

Implementations§

Source§

impl CosConfig

Source

pub fn get_bucket(&self) -> String

获取当前提供商的存储桶名称

Source

pub fn get_cdn_domain(&self) -> Option<String>

获取当前提供商的 CDN 域名

Source

pub fn get_endpoint(&self) -> Option<String>

获取当前提供商的 Endpoint

Source

pub fn get_root_path(&self) -> Option<String>

获取本地文件系统的根路径(仅 RustFS)

Trait Implementations§

Source§

impl Clone for CosConfig

Source§

fn clone(&self) -> CosConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CosConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CosConfig

Source§

fn default() -> CosConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CosConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for CosConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,