Struct monoio_http_client::ClientRequest
source · pub struct ClientRequest<B, C = PooledConnector<TcpConnector, Key, TcpStream, B>, CS = PooledConnector<TlsConnector, Key, ClientTlsStream<TcpStream>, B>> { /* private fields */ }
Implementations§
source§impl<B, C, CS> ClientRequest<B, C, CS>
impl<B, C, CS> ClientRequest<B, C, CS>
pub fn new(client: Client<B, C, CS>) -> Self
pub fn method<T>(self, method: T) -> Selfwhere Method: TryFrom<T>, <Method as TryFrom<T>>::Error: Into<Error>,
pub fn uri<T>(self, uri: T) -> Selfwhere Uri: TryFrom<T>, <Uri as TryFrom<T>>::Error: Into<Error>,
pub fn header<K, V>(self, key: K, value: V) -> Selfwhere HeaderName: TryFrom<K>, <HeaderName as TryFrom<K>>::Error: Into<Error>, HeaderValue: TryFrom<V>, <HeaderValue as TryFrom<V>>::Error: Into<Error>,
source§impl<B> ClientRequest<B>where
B: Body<Data = Bytes, Error = HttpError> + FixedBody<BodyType = B> + 'static,
HttpBody: From<B>,
impl<B> ClientRequest<B>where B: Body<Data = Bytes, Error = HttpError> + FixedBody<BodyType = B> + 'static, HttpBody: From<B>,
pub async fn send(self) -> Result<ClientResponse>
pub async fn send_body(self, data: Bytes) -> Result<ClientResponse>
pub async fn send_json<T: Serialize>(self, data: &T) -> Result<ClientResponse>
Auto Trait Implementations§
impl<B, C = PooledConnector<TcpConnector, Key, TcpStream, B>, CS = PooledConnector<TlsConnector, Key, Stream<TcpStream, ClientConnection>, B>> !RefUnwindSafe for ClientRequest<B, C, CS>
impl<B, C = PooledConnector<TcpConnector, Key, TcpStream, B>, CS = PooledConnector<TlsConnector, Key, Stream<TcpStream, ClientConnection>, B>> !Send for ClientRequest<B, C, CS>
impl<B, C = PooledConnector<TcpConnector, Key, TcpStream, B>, CS = PooledConnector<TlsConnector, Key, Stream<TcpStream, ClientConnection>, B>> !Sync for ClientRequest<B, C, CS>
impl<B, C, CS> Unpin for ClientRequest<B, C, CS>where B: Unpin,
impl<B, C = PooledConnector<TcpConnector, Key, TcpStream, B>, CS = PooledConnector<TlsConnector, Key, Stream<TcpStream, ClientConnection>, B>> !UnwindSafe for ClientRequest<B, C, CS>
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