pub struct BinaryTask { /* private fields */ }Expand description
One bounded in-memory HTTP GET request.
Implementations§
Source§impl BinaryTask
impl BinaryTask
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
Creates a task. URL validation happens synchronously during enqueue.
Sourcepub fn with_headers(self, headers: HeaderMap) -> Self
pub fn with_headers(self, headers: HeaderMap) -> Self
Replaces request headers.
Sourcepub fn with_header(self, name: HeaderName, value: HeaderValue) -> Self
pub fn with_header(self, name: HeaderName, value: HeaderValue) -> Self
Adds or replaces one request header.
Sourcepub fn with_max_body_bytes(self, max_body_bytes: u64) -> Self
pub fn with_max_body_bytes(self, max_body_bytes: u64) -> Self
Applies a task-specific body limit. It may only tighten the client limit.
Sourcepub fn max_body_bytes(&self) -> Option<u64>
pub fn max_body_bytes(&self) -> Option<u64>
Returns the task-specific body limit, if set.
Trait Implementations§
Source§impl Clone for BinaryTask
impl Clone for BinaryTask
Source§fn clone(&self) -> BinaryTask
fn clone(&self) -> BinaryTask
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BinaryTask
impl RefUnwindSafe for BinaryTask
impl Send for BinaryTask
impl Sync for BinaryTask
impl Unpin for BinaryTask
impl UnsafeUnpin for BinaryTask
impl UnwindSafe for BinaryTask
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