pub enum V2Transport {
Grpc(AgentClientV2),
Uds(AgentClientV2Uds),
Reverse(ReverseConnectionClient),
}Expand description
Transport layer for v2 agent connections.
Supports gRPC, Unix Domain Socket, and reverse connections.
Variants§
Grpc(AgentClientV2)
gRPC over HTTP/2
Uds(AgentClientV2Uds)
Binary protocol over Unix Domain Socket
Reverse(ReverseConnectionClient)
Reverse connection (agent connected to proxy)
Implementations§
Source§impl V2Transport
impl V2Transport
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if the transport is connected.
Sourcepub async fn can_accept_requests(&self) -> bool
pub async fn can_accept_requests(&self) -> bool
Check if the transport can accept new requests.
Returns false if the agent has sent a flow control pause signal.
Sourcepub async fn capabilities(&self) -> Option<AgentCapabilities>
pub async fn capabilities(&self) -> Option<AgentCapabilities>
Get negotiated capabilities.
Sourcepub async fn send_request_headers(
&self,
correlation_id: &str,
event: &RequestHeadersEvent,
) -> Result<AgentResponse, AgentProtocolError>
pub async fn send_request_headers( &self, correlation_id: &str, event: &RequestHeadersEvent, ) -> Result<AgentResponse, AgentProtocolError>
Send a request headers event.
Sourcepub async fn send_request_body_chunk(
&self,
correlation_id: &str,
event: &RequestBodyChunkEvent,
) -> Result<AgentResponse, AgentProtocolError>
pub async fn send_request_body_chunk( &self, correlation_id: &str, event: &RequestBodyChunkEvent, ) -> Result<AgentResponse, AgentProtocolError>
Send a request body chunk event.
Sourcepub async fn send_response_headers(
&self,
correlation_id: &str,
event: &ResponseHeadersEvent,
) -> Result<AgentResponse, AgentProtocolError>
pub async fn send_response_headers( &self, correlation_id: &str, event: &ResponseHeadersEvent, ) -> Result<AgentResponse, AgentProtocolError>
Send a response headers event.
Sourcepub async fn send_response_body_chunk(
&self,
correlation_id: &str,
event: &ResponseBodyChunkEvent,
) -> Result<AgentResponse, AgentProtocolError>
pub async fn send_response_body_chunk( &self, correlation_id: &str, event: &ResponseBodyChunkEvent, ) -> Result<AgentResponse, AgentProtocolError>
Send a response body chunk event.
Sourcepub async fn send_guardrail_inspect(
&self,
correlation_id: &str,
event: &GuardrailInspectEvent,
) -> Result<AgentResponse, AgentProtocolError>
pub async fn send_guardrail_inspect( &self, correlation_id: &str, event: &GuardrailInspectEvent, ) -> Result<AgentResponse, AgentProtocolError>
Send a guardrail inspect event.
Sourcepub async fn cancel_request(
&self,
correlation_id: &str,
reason: CancelReason,
) -> Result<(), AgentProtocolError>
pub async fn cancel_request( &self, correlation_id: &str, reason: CancelReason, ) -> Result<(), AgentProtocolError>
Cancel a specific request.
Sourcepub async fn cancel_all(
&self,
reason: CancelReason,
) -> Result<usize, AgentProtocolError>
pub async fn cancel_all( &self, reason: CancelReason, ) -> Result<usize, AgentProtocolError>
Cancel all in-flight requests.
Sourcepub async fn close(&self) -> Result<(), AgentProtocolError>
pub async fn close(&self) -> Result<(), AgentProtocolError>
Close the transport.
Auto Trait Implementations§
impl !Freeze for V2Transport
impl !RefUnwindSafe for V2Transport
impl Send for V2Transport
impl Sync for V2Transport
impl Unpin for V2Transport
impl UnsafeUnpin for V2Transport
impl !UnwindSafe for V2Transport
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request