pub struct RequestParts {
pub method: Method,
pub url: Url,
pub headers: HeaderMap,
pub body: Option<RequestBody>,
pub version: Option<Version>,
pub timeout: Option<Duration>,
pub request_id: Option<String>,
}Fields§
§method: Method§url: Url§headers: HeaderMap§body: Option<RequestBody>§version: Option<Version>§timeout: Option<Duration>§request_id: Option<String>Implementations§
Source§impl RequestParts
impl RequestParts
pub fn new(method: Method, url: Url) -> Self
pub fn header(self, key: impl AsRef<str>, value: impl AsRef<str>) -> Self
pub fn try_header( self, key: impl AsRef<str>, value: impl AsRef<str>, ) -> Result<Self, HeaderError>
pub fn headers(self, headers: HeaderMap) -> Self
pub fn body(self, body: RequestBody) -> Self
pub fn text(self, text: impl Into<String>) -> Self
pub fn json(self, value: Value) -> Self
pub fn form(self, form: Vec<(String, String)>) -> Self
pub fn form_pairs<I, K, V>(self, pairs: I) -> Self
pub fn multipart(self, form: Form) -> Self
pub fn empty(self) -> Self
pub fn version(self, version: Version) -> Self
pub fn timeout(self, timeout: Duration) -> Self
pub fn request_id(self, request_id: impl Into<String>) -> Self
pub fn into_request_builder( self, client: &Client, ) -> (RequestBuilder, Option<String>)
pub fn into_request(self, client: &Client) -> Result<Request, Error>
pub async fn send(self) -> Result<Response, Error>
pub fn from_file(self, file: File) -> Self
pub fn from_file_buffered(self, file: File, buffer_size: usize) -> Self
pub async fn from_file_path<P: AsRef<Path>>( self, path: P, ) -> Result<Self, StreamError>
pub async fn from_file_path_buffered<P: AsRef<Path>>( self, path: P, buffer_size: usize, ) -> Result<Self, StreamError>
pub fn from_async_read<R>(self, reader: R) -> Self
pub fn from_tcp_stream(self, tcp: TcpStream) -> Self
pub fn from_command_output(self, command: Command) -> Result<Self, StreamError>
pub fn stream<S>(self, stream: S) -> Self
pub fn io_stream<S>(self, stream: S) -> Self
Trait Implementations§
Source§impl Debug for RequestParts
impl Debug for RequestParts
Source§impl IntoRequestParts for RequestParts
impl IntoRequestParts for RequestParts
fn into_request_parts(self) -> RequestParts
Auto Trait Implementations§
impl !Freeze for RequestParts
impl !RefUnwindSafe for RequestParts
impl Send for RequestParts
impl Sync for RequestParts
impl Unpin for RequestParts
impl !UnwindSafe for RequestParts
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