pub struct RequestBuilder { /* private fields */ }
Expand description
HTTP request builder.
Implementations§
Source§impl RequestBuilder
impl RequestBuilder
Sourcepub fn set_version(self, version: Version) -> Self
pub fn set_version(self, version: Version) -> Self
Set the protocol version.
Sourcepub fn set_method(self, method: Method) -> Self
pub fn set_method(self, method: Method) -> Self
Set the request method.
Sourcepub fn set_path(self, path: RequestPath) -> Self
pub fn set_path(self, path: RequestPath) -> Self
Set the request path.
Sourcepub fn set_header_field<T>(self, field: T) -> Selfwhere
T: Into<HeaderField>,
pub fn set_header_field<T>(self, field: T) -> Selfwhere
T: Into<HeaderField>,
Replace the current header fields having the same name (if any).
Sourcepub fn add_header_field<T>(self, field: T) -> Selfwhere
T: Into<HeaderField>,
pub fn add_header_field<T>(self, field: T) -> Selfwhere
T: Into<HeaderField>,
Add a given header field.
Sourcepub fn remove_header_fields<N>(self, name: &N) -> Self
pub fn remove_header_fields<N>(self, name: &N) -> Self
Remove all header fields with a given name.
Sourcepub fn header(self) -> RequestHeader
pub fn header(self) -> RequestHeader
Build just the request header.
Trait Implementations§
Source§impl Clone for RequestBuilder
impl Clone for RequestBuilder
Source§fn clone(&self) -> RequestBuilder
fn clone(&self) -> RequestBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl From<RequestHeader> for RequestBuilder
impl From<RequestHeader> for RequestBuilder
Source§fn from(header: RequestHeader) -> Self
fn from(header: RequestHeader) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for RequestBuilder
impl RefUnwindSafe for RequestBuilder
impl Send for RequestBuilder
impl Sync for RequestBuilder
impl Unpin for RequestBuilder
impl UnwindSafe for RequestBuilder
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