pub struct Chain<A, B>(pub A, pub B);Expand description
Combine two dispatchers, trying the first then falling through to the
second on NotFound.
Use this to serve multiple code-generated FooServiceServer<T> structs
from a single ConnectRpcService:
ⓘ
use connectrpc::{ConnectRpcService, Chain};
let service = ConnectRpcService::new(
Chain(
FortuneServiceServer::new(fortune_impl),
Chain(
BenchServiceServer::new(bench_impl),
GreetServiceServer::new(greet_impl),
),
),
);For more than ~5 services, prefer Router — the
linear fallthrough cost scales with chain depth.
Tuple Fields§
§0: A§1: BTrait Implementations§
Source§impl<A: Dispatcher, B: Dispatcher> Dispatcher for Chain<A, B>
impl<A: Dispatcher, B: Dispatcher> Dispatcher for Chain<A, B>
Source§fn lookup(&self, path: &str) -> Option<MethodDescriptor>
fn lookup(&self, path: &str) -> Option<MethodDescriptor>
Look up a method by its
service_name/method_name path. Read moreSource§fn call_unary(
&self,
path: &str,
ctx: RequestContext,
request: Payload,
format: CodecFormat,
) -> UnaryResult
fn call_unary( &self, path: &str, ctx: RequestContext, request: Payload, format: CodecFormat, ) -> UnaryResult
Dispatch a unary call. Read more
Source§fn call_server_streaming(
&self,
path: &str,
ctx: RequestContext,
request: Bytes,
format: CodecFormat,
) -> StreamingResult
fn call_server_streaming( &self, path: &str, ctx: RequestContext, request: Bytes, format: CodecFormat, ) -> StreamingResult
Dispatch a server-streaming call. Read more
Source§fn call_client_streaming(
&self,
path: &str,
ctx: RequestContext,
requests: RequestStream,
format: CodecFormat,
) -> UnaryResult
fn call_client_streaming( &self, path: &str, ctx: RequestContext, requests: RequestStream, format: CodecFormat, ) -> UnaryResult
Dispatch a client-streaming call. Read more
Source§fn call_bidi_streaming(
&self,
path: &str,
ctx: RequestContext,
requests: RequestStream,
format: CodecFormat,
) -> StreamingResult
fn call_bidi_streaming( &self, path: &str, ctx: RequestContext, requests: RequestStream, format: CodecFormat, ) -> StreamingResult
Dispatch a bidi-streaming call. Read more
Auto Trait Implementations§
impl<A, B> Freeze for Chain<A, B>
impl<A, B> RefUnwindSafe for Chain<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Chain<A, B>
impl<A, B> Sync for Chain<A, B>
impl<A, B> Unpin for Chain<A, B>
impl<A, B> UnsafeUnpin for Chain<A, B>where
A: UnsafeUnpin,
B: UnsafeUnpin,
impl<A, B> UnwindSafe for Chain<A, B>where
A: UnwindSafe,
B: UnwindSafe,
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