Struct qiniu_download::RangeReaderBuilder
source · [−]pub struct RangeReaderBuilder(_);
Expand description
对象范围下载构建器
Implementations
sourceimpl 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 RefUnwindSafe for RangeReaderBuilder
impl Send for RangeReaderBuilder
impl Sync for RangeReaderBuilder
impl Unpin for RangeReaderBuilder
impl UnwindSafe for RangeReaderBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
sourcefn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
Pipes by value. This is generally the method you want to use. Read more
sourcefn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
Borrows self
and passes that borrow into the pipe function. Read more
sourcefn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
Mutably borrows self
and passes that borrow into the pipe function. Read more
sourcefn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
Borrows self
, then passes self.borrow()
into the pipe function. Read more
sourcefn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
Mutably borrows self
, then passes self.borrow_mut()
into the pipe
function. Read more
sourcefn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows self
, then passes self.as_ref()
into the pipe function.
sourcefn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
Mutably borrows self
, then passes self.as_mut()
into the pipe
function. Read more
sourceimpl<T> Tap for T
impl<T> Tap for T
sourcefn tap_mut(self, func: impl for<'_> FnOnce(&mut Self)) -> Self
fn tap_mut(self, func: impl for<'_> FnOnce(&mut Self)) -> Self
Mutable access to a value. Read more
sourcefn tap_borrow<B>(self, func: impl for<'_> FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl for<'_> FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Immutable access to the Borrow<B>
of a value. Read more
sourcefn tap_borrow_mut<B>(self, func: impl for<'_> FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl for<'_> FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the BorrowMut<B>
of a value. Read more
sourcefn tap_ref<R>(self, func: impl for<'_> FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl for<'_> FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Immutable access to the AsRef<R>
view of a value. Read more
sourcefn tap_ref_mut<R>(self, func: impl for<'_> FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl for<'_> FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Mutable access to the AsMut<R>
view of a value. Read more
sourcefn tap_deref<T>(self, func: impl for<'_> FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl for<'_> FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Immutable access to the Deref::Target
of a value. Read more
sourcefn tap_deref_mut<T>(self, func: impl for<'_> FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl for<'_> FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Mutable access to the Deref::Target
of a value. Read more
sourcefn tap_dbg(self, func: impl for<'_> FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl for<'_> FnOnce(&Self)) -> Self
Calls .tap()
only in debug builds, and is erased in release builds.
sourcefn tap_mut_dbg(self, func: impl for<'_> FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl for<'_> FnOnce(&mut Self)) -> Self
Calls .tap_mut()
only in debug builds, and is erased in release
builds. Read more
sourcefn tap_borrow_dbg<B>(self, func: impl for<'_> FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl for<'_> FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Calls .tap_borrow()
only in debug builds, and is erased in release
builds. Read more
sourcefn tap_borrow_mut_dbg<B>(self, func: impl for<'_> FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl for<'_> FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Calls .tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read more
sourcefn tap_ref_dbg<R>(self, func: impl for<'_> FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl for<'_> FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Calls .tap_ref()
only in debug builds, and is erased in release
builds. Read more
sourcefn tap_ref_mut_dbg<R>(self, func: impl for<'_> FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl for<'_> FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Calls .tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more