pub struct Timeouts {
pub header_read: Duration,
pub body: Duration,
pub upload_body: Duration,
pub request: Duration,
}Expand description
服务端超时,防 slowloris 和挂死的请求。
Fields§
§header_read: Duration读完请求头的时限(HTTP/1),超时直接断开连接。只在 serve_with 里生效。
body: Duration从请求进来到读完请求体的总时限,不是两次读之间的间隔:每 5 秒滴 1 字节也会超时。
upload_body: Duration/v2/parse 上传文件的请求体时限(同样是总时限):50 MB 的文件 30 秒传完要 1.7 MB/s,
上传单独放宽。
request: Duration整个请求(到响应头发出为止)的时限。要比同步 scrape 的 timeout 上限大,
crawl/batch 只是创建任务,很快返回,不受影响。
Trait Implementations§
impl Copy for Timeouts
impl Eq for Timeouts
impl StructuralPartialEq for Timeouts
Auto Trait Implementations§
impl Freeze for Timeouts
impl RefUnwindSafe for Timeouts
impl Send for Timeouts
impl Sync for Timeouts
impl Unpin for Timeouts
impl UnsafeUnpin for Timeouts
impl UnwindSafe for Timeouts
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§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.