pub struct ReverseConnectionClient { /* private fields */ }Expand description
Client wrapper for a reverse connection.
This wraps an accepted connection and provides the same interface as AgentClientV2Uds but for inbound connections.
Implementations§
Source§impl ReverseConnectionClient
impl ReverseConnectionClient
Sourcepub fn connection_id(&self) -> &str
pub fn connection_id(&self) -> &str
Get the connection ID.
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if connected.
Sourcepub async fn capabilities(&self) -> Option<AgentCapabilities>
pub async fn capabilities(&self) -> Option<AgentCapabilities>
Get capabilities.
Sourcepub async fn is_paused(&self) -> bool
pub async fn is_paused(&self) -> bool
Check if the agent has requested flow control pause.
Returns true if the agent sent a FlowAction::Pause signal,
indicating it cannot accept more requests.
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 requested a flow control pause.
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 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 connection.
Auto Trait Implementations§
impl !Freeze for ReverseConnectionClient
impl !RefUnwindSafe for ReverseConnectionClient
impl Send for ReverseConnectionClient
impl Sync for ReverseConnectionClient
impl Unpin for ReverseConnectionClient
impl !UnwindSafe for ReverseConnectionClient
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