pub struct ProxyHandler {
pub config: ProxyConfig,
}👎Deprecated:
Use mockforge_proxy crate directly
Expand description
HTTP proxy request handler
Fields§
§config: ProxyConfig👎Deprecated:
Use mockforge_proxy crate directly
Handler configuration
Implementations§
Source§impl ProxyHandler
impl ProxyHandler
Sourcepub fn new(config: ProxyConfig) -> Self
👎Deprecated: Use mockforge_proxy crate directly
pub fn new(config: ProxyConfig) -> Self
Use mockforge_proxy crate directly
Create a new proxy handler
Sourcepub async fn handle_request(
&self,
method: &str,
url: &str,
headers: &HashMap<String, String>,
body: Option<&[u8]>,
) -> Result<ProxyResponse>
👎Deprecated: Use mockforge_proxy crate directly
pub async fn handle_request( &self, method: &str, url: &str, headers: &HashMap<String, String>, body: Option<&[u8]>, ) -> Result<ProxyResponse>
Use mockforge_proxy crate directly
Handle an HTTP request by proxying it
Sourcepub async fn proxy_request(
&self,
method: &Method,
uri: &Uri,
headers: &HeaderMap,
body: Option<&[u8]>,
) -> Result<ProxyResponse>
👎Deprecated: Use mockforge_proxy crate directly
pub async fn proxy_request( &self, method: &Method, uri: &Uri, headers: &HeaderMap, body: Option<&[u8]>, ) -> Result<ProxyResponse>
Use mockforge_proxy crate directly
Proxy a request with full HTTP types
Auto Trait Implementations§
impl Freeze for ProxyHandler
impl RefUnwindSafe for ProxyHandler
impl Send for ProxyHandler
impl Sync for ProxyHandler
impl Unpin for ProxyHandler
impl UnsafeUnpin for ProxyHandler
impl UnwindSafe for ProxyHandler
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more