#[non_exhaustive]pub struct ProxyService { /* private fields */ }Expand description
The forward proxy service.
Implementations§
Source§impl ProxyService
impl ProxyService
pub fn new( config: ProxyConfig, injector: CredentialInjector, leak_detector: LeakDetector, ) -> Result<Self, ProxyError>
Sourcepub fn with_client(self, client: Client) -> Self
pub fn with_client(self, client: Client) -> Self
Attach a shared rate limiter. Use a pre-built HTTP client (for connection pooling across services).
pub fn with_rate_limiter(self, limiter: Arc<RateLimiter>) -> Self
Sourcepub fn with_rate_limit_key(self, key: impl Into<String>) -> Self
pub fn with_rate_limit_key(self, key: impl Into<String>) -> Self
Set the rate limit key (typically tool name or container ID).
Sourcepub async fn forward_request(
&self,
url: &str,
method: &str,
headers: HashMap<String, String>,
body: Option<String>,
) -> Result<ProxyResponse, ProxyError>
pub async fn forward_request( &self, url: &str, method: &str, headers: HashMap<String, String>, body: Option<String>, ) -> Result<ProxyResponse, ProxyError>
Forward a request through the proxy pipeline.
Auto Trait Implementations§
impl Freeze for ProxyService
impl !RefUnwindSafe for ProxyService
impl Send for ProxyService
impl Sync for ProxyService
impl Unpin for ProxyService
impl UnsafeUnpin for ProxyService
impl !UnwindSafe for ProxyService
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