pub struct Config { /* private fields */ }
Expand description
单集群七牛配置信息
Implementations§
Source§impl Config
impl Config
Sourcepub fn builder(
access_key: impl Into<String>,
secret_key: impl Into<String>,
bucket: impl Into<String>,
io_urls: Option<Vec<String>>,
) -> ConfigBuilder
pub fn builder( access_key: impl Into<String>, secret_key: impl Into<String>, bucket: impl Into<String>, io_urls: Option<Vec<String>>, ) -> ConfigBuilder
创建七牛配置信息构建器
Sourcepub fn access_key(&self) -> &str
pub fn access_key(&self) -> &str
获取七牛 Access Key
Sourcepub fn set_access_key(&mut self, access_key: impl Into<String>) -> &mut Self
pub fn set_access_key(&mut self, access_key: impl Into<String>) -> &mut Self
设置七牛 Access Key
Sourcepub fn secret_key(&self) -> &str
pub fn secret_key(&self) -> &str
获取七牛 Secret Key
Sourcepub fn set_secret_key(&mut self, secret_key: impl Into<String>) -> &mut Self
pub fn set_secret_key(&mut self, secret_key: impl Into<String>) -> &mut Self
设置七牛 Secret Key
Sourcepub fn set_bucket(&mut self, bucket: impl Into<String>) -> &mut Self
pub fn set_bucket(&mut self, bucket: impl Into<String>) -> &mut Self
设置七牛存储空间
Sourcepub fn set_io_urls(
&mut self,
io_urls: Option<impl Into<Vec<String>>>,
) -> &mut Self
pub fn set_io_urls( &mut self, io_urls: Option<impl Into<Vec<String>>>, ) -> &mut Self
设置 IO 服务器 URL 列表
Sourcepub fn set_uc_urls(
&mut self,
uc_urls: Option<impl Into<Vec<String>>>,
) -> &mut Self
pub fn set_uc_urls( &mut self, uc_urls: Option<impl Into<Vec<String>>>, ) -> &mut Self
设置 UC 服务器 URL 列表
Sourcepub fn monitor_urls(&self) -> Option<&[String]>
pub fn monitor_urls(&self) -> Option<&[String]>
获取监控服务器服务器 URL 列表
Sourcepub fn set_monitor_urls(
&mut self,
monitor_urls: Option<impl Into<Vec<String>>>,
) -> &mut Self
pub fn set_monitor_urls( &mut self, monitor_urls: Option<impl Into<Vec<String>>>, ) -> &mut Self
设置监控服务器 URL 列表
Sourcepub fn use_getfile_api(&self) -> Option<bool>
pub fn use_getfile_api(&self) -> Option<bool>
是否使用 Getfile API
Sourcepub fn set_use_getfile_api(
&mut self,
use_getfile_api: Option<bool>,
) -> &mut Self
pub fn set_use_getfile_api( &mut self, use_getfile_api: Option<bool>, ) -> &mut Self
设置是否使用 Getfile API
Sourcepub fn normalize_key(&self) -> Option<bool>
pub fn normalize_key(&self) -> Option<bool>
是否对 key 进行格式化
Sourcepub fn set_normalize_key(&mut self, normalize_key: Option<bool>) -> &mut Self
pub fn set_normalize_key(&mut self, normalize_key: Option<bool>) -> &mut Self
设置是否对 key 进行格式化
Sourcepub fn set_private(&mut self, private: Option<bool>) -> &mut Self
pub fn set_private(&mut self, private: Option<bool>) -> &mut Self
设置是否使用私有存储空间
Sourcepub fn dot_interval(&self) -> Option<Duration>
pub fn dot_interval(&self) -> Option<Duration>
获取打点记录上传频率
Sourcepub fn set_dot_interval(&mut self, dot_interval: Option<Duration>) -> &mut Self
pub fn set_dot_interval(&mut self, dot_interval: Option<Duration>) -> &mut Self
设置打点记录上传频率
Sourcepub fn max_dot_buffer_size(&self) -> Option<u64>
pub fn max_dot_buffer_size(&self) -> Option<u64>
获取打点记录本地缓存文件尺寸上限
Sourcepub fn set_max_dot_buffer_size(
&mut self,
max_dot_buffer_size: Option<u64>,
) -> &mut Self
pub fn set_max_dot_buffer_size( &mut self, max_dot_buffer_size: Option<u64>, ) -> &mut Self
设置打点记录本地缓存文件尺寸上限
Sourcepub fn punish_time(&self) -> Option<Duration>
pub fn punish_time(&self) -> Option<Duration>
获取域名访问失败后的惩罚时长
Sourcepub fn set_punish_time(&mut self, punish_time: Option<Duration>) -> &mut Self
pub fn set_punish_time(&mut self, punish_time: Option<Duration>) -> &mut Self
设置域名访问失败后的惩罚时长
Sourcepub fn base_timeout(&self) -> Option<Duration>
pub fn base_timeout(&self) -> Option<Duration>
获取域名访问的基础超时时长
Sourcepub fn set_base_timeout(&mut self, base_timeout: Option<Duration>) -> &mut Self
pub fn set_base_timeout(&mut self, base_timeout: Option<Duration>) -> &mut Self
设置域名访问失败后的惩罚时长
Sourcepub fn connect_timeout(&self) -> Option<Duration>
pub fn connect_timeout(&self) -> Option<Duration>
获取域名连接的超时时长
Sourcepub fn set_connect_timeout(
&mut self,
connect_timeout: Option<Duration>,
) -> &mut Self
pub fn set_connect_timeout( &mut self, connect_timeout: Option<Duration>, ) -> &mut Self
设置域名连接的超时时长
Sourcepub fn max_retry_concurrency(&self) -> Option<u32>
pub fn max_retry_concurrency(&self) -> Option<u32>
获取最大并行重试次数
Sourcepub fn set_max_retry_concurrency(
&mut self,
max_retry_concurrency: Option<u32>,
) -> &mut Self
pub fn set_max_retry_concurrency( &mut self, max_retry_concurrency: Option<u32>, ) -> &mut Self
设置最大并行重试次数,如果设置为 Some(0) 则表示禁止并行重试功能
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 From<Config> for ConfigBuilder
impl From<Config> for ConfigBuilder
Source§impl From<Config> for Configurable
impl From<Config> for Configurable
Source§fn from(config: SingleClusterConfig) -> Self
fn from(config: SingleClusterConfig) -> Self
Converts to this type from the input type.
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl !Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compares
self
to key
and returns true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.