pub struct ProxyClient { /* private fields */ }
Expand description
A client for proxying HTTP requests to an upstream server.
Implementations§
Source§impl ProxyClient
impl ProxyClient
pub fn new() -> Self
Sourcepub async fn request(
&self,
request: Request<SimpleBody>,
) -> Result<(Response<SimpleBody>, Option<UpgradeHandler>), Infallible>
pub async fn request( &self, request: Request<SimpleBody>, ) -> Result<(Response<SimpleBody>, Option<UpgradeHandler>), Infallible>
Sends an HTTP request to the upstream server and returns the response.
If the request establishes a websocket connection, an upgrade handler is returned.
In this case, you must call and await .run()
on the upgrade handler (i.e. in a tokio task)
to ensure that messages are properly sent and received.
Trait Implementations§
Source§impl Clone for ProxyClient
impl Clone for ProxyClient
Source§fn clone(&self) -> ProxyClient
fn clone(&self) -> ProxyClient
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 moreAuto Trait Implementations§
impl Freeze for ProxyClient
impl !RefUnwindSafe for ProxyClient
impl Send for ProxyClient
impl Sync for ProxyClient
impl Unpin for ProxyClient
impl !UnwindSafe for ProxyClient
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