pub struct Proxy;Expand description
The proxy role - an intermediary that can intercept and modify messages.
Proxies sit between a client and an agent (or another proxy), and can:
- Add tools via MCP servers
- Filter or transform messages
- Inject additional context
Proxies connect to a Conductor which orchestrates the proxy chain.
Implementations§
Source§impl Proxy
impl Proxy
Sourcepub fn builder(self) -> Builder<Proxy, NullHandler, NullRun>
pub fn builder(self) -> Builder<Proxy, NullHandler, NullRun>
Create a stable protocol v1 connection builder for a proxy.
Use Proxy::v2 for a protocol-v2-only proxy with typed callbacks and
wire validation. Protocol-routing infrastructure that deliberately
selects a version itself can disable the guard with
Builder::without_acp_version_guard.
Sourcepub fn v2(self) -> V2Builder<Proxy, NullHandler, NullRun>
Available on crate feature unstable_protocol_v2 only.
pub fn v2(self) -> V2Builder<Proxy, NullHandler, NullRun>
unstable_protocol_v2 only.Create a proxy builder that uses the ACP protocol v2 API.
This builder requires _proxy/initialize to select protocol v2.
Fluent callbacks receive crate::V2ConnectionTo<Conductor>, while
low-level custom handlers and runners retain the protocol-neutral
ConnectionTo interface.
Requires the unstable_protocol_v2 crate feature.
Sourcepub fn protocol_router(self) -> ProxyProtocolRouter
Available on crate feature unstable_protocol_v2 only.
pub fn protocol_router(self) -> ProxyProtocolRouter
unstable_protocol_v2 only.Create a router that chooses between configured proxy implementations.
Add implementations with ProxyProtocolRouter::with_v1 and
ProxyProtocolRouter::with_v2. The router reads the initial
_proxy/initialize request, selects the implementation for that exact
protocol version, and hands over the complete initial transport frame.
It does not downgrade proxy traffic or convert later messages.
Requires the unstable_protocol_v2 crate feature while protocol v2
stabilizes.
Trait Implementations§
impl Copy for Proxy
impl Eq for Proxy
Source§impl HasPeer<Proxy> for Proxy
impl HasPeer<Proxy> for Proxy
Source§fn remote_style(&self, _peer: Proxy) -> RemoteStyle
fn remote_style(&self, _peer: Proxy) -> RemoteStyle
Source§impl Ord for Proxy
impl Ord for Proxy
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Proxy
impl PartialOrd for Proxy
Source§impl Role for Proxy
impl Role for Proxy
Source§type Counterpart = Conductor
type Counterpart = Conductor
Source§fn default_handle_dispatch_from(
&self,
message: Dispatch,
_connection: ConnectionTo<Self>,
) -> impl Future<Output = Result<Handled<Dispatch>, Error>> + Send
fn default_handle_dispatch_from( &self, message: Dispatch, _connection: ConnectionTo<Self>, ) -> impl Future<Output = Result<Handled<Dispatch>, Error>> + Send
Source§fn counterpart(&self) -> Self::Counterpart
fn counterpart(&self) -> Self::Counterpart
impl StructuralPartialEq for Proxy
Auto Trait Implementations§
impl Freeze for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnsafeUnpin for Proxy
impl UnwindSafe for Proxy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.