pub struct ReflectionProxy { /* private fields */ }Expand description
A reflection-based gRPC proxy that can forward requests to arbitrary services
Implementations§
Source§impl ReflectionProxy
impl ReflectionProxy
Sourcepub async fn new(
endpoint: Endpoint,
config: ProxyConfig,
) -> Result<Self, Status>
pub async fn new( endpoint: Endpoint, config: ProxyConfig, ) -> Result<Self, Status>
Create a new reflection proxy
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set the request timeout
Sourcepub async fn forward_unary(
&self,
service_name: &str,
method_name: &str,
request: Request<DynamicMessage>,
) -> Result<Response<DynamicMessage>, Status>
pub async fn forward_unary( &self, service_name: &str, method_name: &str, request: Request<DynamicMessage>, ) -> Result<Response<DynamicMessage>, Status>
Forward a unary request to the target service
Sourcepub async fn forward_server_streaming(
&self,
service_name: &str,
method_name: &str,
request: Request<DynamicMessage>,
) -> Result<Response<Pin<Box<dyn Stream<Item = Result<DynamicMessage, Status>> + Send>>>, Status>
pub async fn forward_server_streaming( &self, service_name: &str, method_name: &str, request: Request<DynamicMessage>, ) -> Result<Response<Pin<Box<dyn Stream<Item = Result<DynamicMessage, Status>> + Send>>>, Status>
Forward a server-streaming request to the target service
Sourcepub async fn forward_client_streaming(
&self,
service_name: &str,
method_name: &str,
request: Request<Streaming<DynamicMessage>>,
) -> Result<Response<DynamicMessage>, Status>
pub async fn forward_client_streaming( &self, service_name: &str, method_name: &str, request: Request<Streaming<DynamicMessage>>, ) -> Result<Response<DynamicMessage>, Status>
Forward a client-streaming request to the target service
Sourcepub async fn forward_bidirectional_streaming(
&self,
service_name: &str,
method_name: &str,
request: Request<Streaming<DynamicMessage>>,
) -> Result<Response<Pin<Box<dyn Stream<Item = Result<DynamicMessage, Status>> + Send>>>, Status>
pub async fn forward_bidirectional_streaming( &self, service_name: &str, method_name: &str, request: Request<Streaming<DynamicMessage>>, ) -> Result<Response<Pin<Box<dyn Stream<Item = Result<DynamicMessage, Status>> + Send>>>, Status>
Forward a bidirectional streaming request to the target service
Auto Trait Implementations§
impl Freeze for ReflectionProxy
impl !RefUnwindSafe for ReflectionProxy
impl Send for ReflectionProxy
impl Sync for ReflectionProxy
impl Unpin for ReflectionProxy
impl !UnwindSafe for ReflectionProxy
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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::RequestSource§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