pub struct EngineConfig {
pub bucket: String,
pub region: String,
pub endpoint: String,
pub domain: String,
pub access_key_id: String,
pub access_key_secret: String,
pub secret_id: String,
pub secret_key: String,
pub access_key: String,
pub base_path: String,
}Expand description
引擎配置 — 对齐 PHP config['engine'][$engineName] 配置数组
PHP 配置结构(Setting.php 第 201-228 行):
'storage' => [
'default' => 'local',
'engine' => [
'local' => [],
'qiniu' => ['bucket' => '', 'access_key' => '', 'secret_key' => '', 'domain' => 'http://'],
'aliyun' => ['bucket' => '', 'access_key_id' => '', 'access_key_secret' => '', 'domain' => 'http://'],
'qcloud' => ['bucket' => '', 'region' => '', 'secret_id' => '', 'secret_key' => '', 'domain' => 'http://'],
],
],Rust 端统一为一个结构体,不同引擎使用不同字段。
Fields§
§bucket: String存储桶名称(对齐 PHP bucket)
region: String地域(对齐 PHP region,仅 Qcloud 使用)
endpoint: String端点(对齐 PHP domain/endpoint,Aliyun 使用)
domain: String自定义域名(对齐 PHP domain)
access_key_id: String阿里云 AccessKey ID(对齐 PHP access_key_id)
access_key_secret: String阿里云 AccessKey Secret(对齐 PHP access_key_secret)
secret_id: String腾讯云 SecretId(对齐 PHP secret_id)
secret_key: String腾讯云/七牛 SecretKey(对齐 PHP secret_key)
access_key: String七牛 AccessKey(对齐 PHP access_key)
base_path: String本地存储基础路径(对齐 PHP WEB_PATH)
Implementations§
Source§impl EngineConfig
impl EngineConfig
Sourcepub fn new() -> EngineConfig
pub fn new() -> EngineConfig
创建空配置
Sourcepub fn with_bucket(self, bucket: impl Into<String>) -> EngineConfig
pub fn with_bucket(self, bucket: impl Into<String>) -> EngineConfig
设置 bucket
Sourcepub fn with_region(self, region: impl Into<String>) -> EngineConfig
pub fn with_region(self, region: impl Into<String>) -> EngineConfig
设置 region
Sourcepub fn with_endpoint(self, endpoint: impl Into<String>) -> EngineConfig
pub fn with_endpoint(self, endpoint: impl Into<String>) -> EngineConfig
设置 endpoint
Sourcepub fn with_domain(self, domain: impl Into<String>) -> EngineConfig
pub fn with_domain(self, domain: impl Into<String>) -> EngineConfig
设置 domain
Sourcepub fn with_base_path(self, base_path: impl Into<String>) -> EngineConfig
pub fn with_base_path(self, base_path: impl Into<String>) -> EngineConfig
设置 base_path
Sourcepub fn with_access_key_id(self, key: impl Into<String>) -> EngineConfig
pub fn with_access_key_id(self, key: impl Into<String>) -> EngineConfig
设置 access_key_id
Sourcepub fn with_access_key_secret(self, key: impl Into<String>) -> EngineConfig
pub fn with_access_key_secret(self, key: impl Into<String>) -> EngineConfig
设置 access_key_secret
Sourcepub fn with_secret_id(self, key: impl Into<String>) -> EngineConfig
pub fn with_secret_id(self, key: impl Into<String>) -> EngineConfig
设置 secret_id
Sourcepub fn with_secret_key(self, key: impl Into<String>) -> EngineConfig
pub fn with_secret_key(self, key: impl Into<String>) -> EngineConfig
设置 secret_key
Sourcepub fn with_access_key(self, key: impl Into<String>) -> EngineConfig
pub fn with_access_key(self, key: impl Into<String>) -> EngineConfig
设置 access_key(七牛)
Trait Implementations§
Source§impl Clone for EngineConfig
impl Clone for EngineConfig
Source§fn clone(&self) -> EngineConfig
fn clone(&self) -> EngineConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EngineConfig
impl Debug for EngineConfig
Source§impl Default for EngineConfig
impl Default for EngineConfig
Source§fn default() -> EngineConfig
fn default() -> EngineConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EngineConfig
impl RefUnwindSafe for EngineConfig
impl Send for EngineConfig
impl Sync for EngineConfig
impl Unpin for EngineConfig
impl UnsafeUnpin for EngineConfig
impl UnwindSafe for EngineConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.