pub struct ConfigBuilder(/* private fields */);
Expand description
七牛单集群配置信息构建器
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn new(
access_key: impl Into<String>,
secret_key: impl Into<String>,
bucket: impl Into<String>,
io_urls: Option<Vec<String>>,
) -> Self
pub fn new( access_key: impl Into<String>, secret_key: impl Into<String>, bucket: impl Into<String>, io_urls: Option<Vec<String>>, ) -> Self
创建七牛配置信息构建器
Sourcepub fn access_key(self, access_key: impl Into<String>) -> Self
pub fn access_key(self, access_key: impl Into<String>) -> Self
配置七牛 Access Key
Sourcepub fn secret_key(self, secret_key: impl Into<String>) -> Self
pub fn secret_key(self, secret_key: impl Into<String>) -> Self
配置七牛 Secret Key
Sourcepub fn monitor_urls(self, monitor_urls: Option<Vec<String>>) -> Self
pub fn monitor_urls(self, monitor_urls: Option<Vec<String>>) -> Self
配置监控服务器域名列表,如果不配置或配置为空,则不会启用打点功能
Sourcepub fn use_getfile_api(self, use_getfile_api: Option<bool>) -> Self
pub fn use_getfile_api(self, use_getfile_api: Option<bool>) -> Self
是否使用 Getfile API,默认为 true
Sourcepub fn normalize_key(self, normalize_key: Option<bool>) -> Self
pub fn normalize_key(self, normalize_key: Option<bool>) -> Self
是否对 key 进行格式化,默认为 false
Sourcepub fn punish_duration(self, punish_duration: Option<Duration>) -> Self
pub fn punish_duration(self, punish_duration: Option<Duration>) -> Self
配置域名访问失败后的惩罚时长,默认为 30 分钟
Sourcepub fn base_timeout(self, base_timeout: Option<Duration>) -> Self
pub fn base_timeout(self, base_timeout: Option<Duration>) -> Self
配置域名访问的基础超时时长,默认为 3000 毫秒
Sourcepub fn connect_timeout(self, connect_timeout: Option<Duration>) -> Self
pub fn connect_timeout(self, connect_timeout: Option<Duration>) -> Self
配置域名连接的超时时长,默认为 50 毫秒
Sourcepub fn max_retry_concurrency(self, max_retry_concurrency: Option<u32>) -> Self
pub fn max_retry_concurrency(self, max_retry_concurrency: Option<u32>) -> Self
配置最大并行重试次数,默认为 5,如果设置为 Some(0) 则表示禁止并行重试功能
Sourcepub fn dot_interval(self, dot_interval: Option<Duration>) -> Self
pub fn dot_interval(self, dot_interval: Option<Duration>) -> Self
设置打点记录上传频率,默认为 10 秒
Sourcepub fn max_dot_buffer_size(self, max_dot_buffer_size: Option<u64>) -> Self
pub fn max_dot_buffer_size(self, max_dot_buffer_size: Option<u64>) -> Self
设置打点记录本地缓存文件尺寸上限,默认为 1 MB
Trait Implementations§
Source§impl Debug for ConfigBuilder
impl Debug for ConfigBuilder
Auto Trait Implementations§
impl !Freeze for ConfigBuilder
impl !RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl !UnwindSafe for ConfigBuilder
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> 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.