pub enum Either<A, B> {
Left(A),
Right(B),
}
Expand description
tower::util::Either
but
adjusted to satisfy the trait bound `RpcServiceT.
Variants§
Trait Implementations§
Source§impl<A, B> RpcServiceT for Either<A, B>where
A: Send + RpcServiceT,
B: RpcServiceT<MethodResponse = <A as RpcServiceT>::MethodResponse, NotificationResponse = <A as RpcServiceT>::NotificationResponse, BatchResponse = <A as RpcServiceT>::BatchResponse> + Send,
impl<A, B> RpcServiceT for Either<A, B>where
A: Send + RpcServiceT,
B: RpcServiceT<MethodResponse = <A as RpcServiceT>::MethodResponse, NotificationResponse = <A as RpcServiceT>::NotificationResponse, BatchResponse = <A as RpcServiceT>::BatchResponse> + Send,
Source§type BatchResponse = <A as RpcServiceT>::BatchResponse
type BatchResponse = <A as RpcServiceT>::BatchResponse
Response type for
RpcServiceT::batch
.Source§type MethodResponse = <A as RpcServiceT>::MethodResponse
type MethodResponse = <A as RpcServiceT>::MethodResponse
Response type for
RpcServiceT::call
.Source§type NotificationResponse = <A as RpcServiceT>::NotificationResponse
type NotificationResponse = <A as RpcServiceT>::NotificationResponse
Response type for
RpcServiceT::notification
.Source§fn call<'a>(
&self,
request: Request<'a>,
) -> impl Future<Output = <Either<A, B> as RpcServiceT>::MethodResponse> + Send + 'a
fn call<'a>( &self, request: Request<'a>, ) -> impl Future<Output = <Either<A, B> as RpcServiceT>::MethodResponse> + Send + 'a
Processes a single JSON-RPC call, which may be a subscription or regular call.
Source§fn batch<'a>(
&self,
batch: Batch<'a>,
) -> impl Future<Output = <Either<A, B> as RpcServiceT>::BatchResponse> + Send + 'a
fn batch<'a>( &self, batch: Batch<'a>, ) -> impl Future<Output = <Either<A, B> as RpcServiceT>::BatchResponse> + Send + 'a
Processes multiple JSON-RPC calls at once, similar to
RpcServiceT::call
. Read moreSource§fn notification<'a>(
&self,
n: Notification<'a, Option<Cow<'a, RawValue>>>,
) -> impl Future<Output = <Either<A, B> as RpcServiceT>::NotificationResponse> + Send + 'a
fn notification<'a>( &self, n: Notification<'a, Option<Cow<'a, RawValue>>>, ) -> impl Future<Output = <Either<A, B> as RpcServiceT>::NotificationResponse> + Send + 'a
Similar to
RpcServiceT::call
but processes a JSON-RPC notification.Auto Trait Implementations§
impl<A, B> Freeze for Either<A, B>
impl<A, B> RefUnwindSafe for Either<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Either<A, B>
impl<A, B> Sync for Either<A, B>
impl<A, B> Unpin for Either<A, B>
impl<A, B> UnwindSafe for Either<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