pub struct RangeReaderBuilder(/* private fields */);
Expand description
对象范围下载构建器
Implementations§
Source§impl RangeReaderBuilder
impl RangeReaderBuilder
Sourcepub fn new(
bucket: impl Into<String>,
key: impl Into<String>,
credential: Credential,
io_urls: Vec<String>,
) -> Self
pub fn new( bucket: impl Into<String>, key: impl Into<String>, credential: Credential, io_urls: Vec<String>, ) -> Self
Sourcepub fn monitor_urls(self, urls: Vec<String>) -> Self
pub fn monitor_urls(self, urls: Vec<String>) -> Self
设置七牛监控服务器 URL 列表
Sourcepub fn update_interval(self, interval: Duration) -> Self
pub fn update_interval(self, interval: Duration) -> Self
设置 UC 查询的频率
Sourcepub fn punish_duration(self, duration: Duration) -> Self
pub fn punish_duration(self, duration: Duration) -> Self
设置域名访问失败后的惩罚时长
Sourcepub fn base_timeout(self, timeout: Duration) -> Self
pub fn base_timeout(self, timeout: Duration) -> Self
设置域名访问的基础超时时长
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
设置域名访问的连接时长
Sourcepub fn max_punished_times(self, max_times: usize) -> Self
pub fn max_punished_times(self, max_times: usize) -> Self
设置失败域名的最大重试次数
一旦一个域名的被惩罚次数超过限制,则域名选择器不会选择该域名,除非被惩罚的域名比例超过上限,或惩罚时长超过指定时长
Sourcepub fn max_punished_hosts_percent(self, percent: u8) -> Self
pub fn max_punished_hosts_percent(self, percent: u8) -> Self
设置被惩罚的域名最大比例
域名选择器在搜索域名时,一旦被跳过的域名比例大于该值,则下一个域名将被选中,不管该域名是否也被惩罚。一旦该域名成功,则惩罚将立刻被取消
Sourcepub fn use_getfile_api(self, use_getfile_api: bool) -> Self
pub fn use_getfile_api(self, use_getfile_api: bool) -> Self
设置是否使用 getfile API 下载
Sourcepub fn normalize_key(self, normalize_key: bool) -> Self
pub fn normalize_key(self, normalize_key: bool) -> Self
设置是否对 key 进行格式化
Sourcepub fn private_url_lifetime(
self,
private_url_lifetime: Option<Duration>,
) -> Self
pub fn private_url_lifetime( self, private_url_lifetime: Option<Duration>, ) -> Self
设置私有空间下载 URL 有效期,如果为 None,则使用公开空间下载 URL
Sourcepub fn dot_interval(self, dot_interval: Duration) -> Self
pub fn dot_interval(self, dot_interval: Duration) -> Self
设置打点记录上传频率
Sourcepub fn max_dot_buffer_size(self, max_dot_buffer_size: u64) -> Self
pub fn max_dot_buffer_size(self, max_dot_buffer_size: u64) -> Self
设置打点记录本地缓存文件尺寸上限
Sourcepub fn max_retry_concurrency(self, max_retry_concurrency: u32) -> Self
pub fn max_retry_concurrency(self, max_retry_concurrency: u32) -> Self
设置最大并行重试次数,如果设置为 0 则表示禁止并行重试功能
Sourcepub fn build(self) -> RangeReader
pub fn build(self) -> RangeReader
构建范围下载器
Sourcepub fn from_config(key: impl Into<String>, config: &Config) -> Self
pub fn from_config(key: impl Into<String>, config: &Config) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RangeReaderBuilder
impl RefUnwindSafe for RangeReaderBuilder
impl Send for RangeReaderBuilder
impl Sync for RangeReaderBuilder
impl Unpin for RangeReaderBuilder
impl UnwindSafe for RangeReaderBuilder
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.