pub struct ProxyBuilder { /* private fields */ }Expand description
Ergonomic builder for constructing a ProxyService.
Implementations§
Source§impl ProxyBuilder
impl ProxyBuilder
pub fn new() -> Self
Sourcepub fn upstream_url(self, url: &str) -> Self
pub fn upstream_url(self, url: &str) -> Self
Set the upstream URL.
Sourcepub fn upstream_tcp(self, host: &str, port: u16) -> Self
pub fn upstream_tcp(self, host: &str, port: u16) -> Self
Set the upstream TCP target.
Sourcepub fn max_body_size(self, size: usize) -> Self
pub fn max_body_size(self, size: usize) -> Self
Set max body size.
Sourcepub fn with_logging(self) -> Self
pub fn with_logging(self) -> Self
Enable structured logging middleware.
Sourcepub fn with_body_logging(self) -> Self
pub fn with_body_logging(self) -> Self
Enable logging with body content.
Sourcepub fn with_inspector(self) -> Self
pub fn with_inspector(self) -> Self
Enable the traffic inspector.
Sourcepub fn inspector_capacity(self, capacity: usize) -> Self
pub fn inspector_capacity(self, capacity: usize) -> Self
Set inspector event store capacity.
Sourcepub fn layer(self, layer: impl ProxyLayer + 'static) -> Self
pub fn layer(self, layer: impl ProxyLayer + 'static) -> Self
Add a custom middleware layer.
Sourcepub fn listener(self, listener: impl TransportListener + 'static) -> Self
pub fn listener(self, listener: impl TransportListener + 'static) -> Self
Use a custom transport listener.
Sourcepub fn connector(self, connector: impl TransportConnector + 'static) -> Self
pub fn connector(self, connector: impl TransportConnector + 'static) -> Self
Use a custom transport connector.
Sourcepub fn conversions(self, registry: ConversionRegistry) -> Self
pub fn conversions(self, registry: ConversionRegistry) -> Self
Set the conversion registry.
Sourcepub fn config(self, config: ProxyConfig) -> Self
pub fn config(self, config: ProxyConfig) -> Self
Set the full proxy config.
Sourcepub fn build(self) -> ProxyResult<ProxyService>
pub fn build(self) -> ProxyResult<ProxyService>
Build the proxy service.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProxyBuilder
impl !RefUnwindSafe for ProxyBuilder
impl Send for ProxyBuilder
impl Sync for ProxyBuilder
impl Unpin for ProxyBuilder
impl UnsafeUnpin for ProxyBuilder
impl !UnwindSafe for ProxyBuilder
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