pub struct AgentProxyBuilder { /* private fields */ }Expand description
Builder for AgentProxy.
§Example
ⓘ
use agent_proxy_rust_core::{AgentProxy, ProxyConfig};
let proxy = AgentProxy::builder()
.config(ProxyConfig::default())
.middleware(my_middleware)
.build()
.unwrap();Implementations§
Source§impl AgentProxyBuilder
impl AgentProxyBuilder
Sourcepub fn cost_recorder(self, cr: Arc<dyn CostRecorder>) -> Self
pub fn cost_recorder(self, cr: Arc<dyn CostRecorder>) -> Self
Sets the cost recorder for post-response billing.
Sourcepub fn config(self, config: ProxyConfig) -> Self
pub fn config(self, config: ProxyConfig) -> Self
Sets the proxy configuration.
Sourcepub fn middleware<M: ProxyMiddleware + 'static>(self, m: M) -> Self
pub fn middleware<M: ProxyMiddleware + 'static>(self, m: M) -> Self
Adds a middleware to the chain (in registration order).
Sourcepub fn build(self) -> Result<AgentProxy, ProxyError>
pub fn build(self) -> Result<AgentProxy, ProxyError>
Trait Implementations§
Source§impl Debug for AgentProxyBuilder
impl Debug for AgentProxyBuilder
Source§impl Default for AgentProxyBuilder
impl Default for AgentProxyBuilder
Source§fn default() -> AgentProxyBuilder
fn default() -> AgentProxyBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for AgentProxyBuilder
impl !UnwindSafe for AgentProxyBuilder
impl Freeze for AgentProxyBuilder
impl Send for AgentProxyBuilder
impl Sync for AgentProxyBuilder
impl Unpin for AgentProxyBuilder
impl UnsafeUnpin for AgentProxyBuilder
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