Trait quic_rpc::ChannelTypes
source · pub trait ChannelTypes: Debug + Sized + Send + Sync + Unpin + Clone + 'static {
type SendSink<M: RpcMessage>: Sink<M, Error = Self::SendError> + Send + Unpin + 'static;
type RecvStream<M: RpcMessage>: Stream<Item = Result<M, Self::RecvError>> + Send + Unpin + 'static;
type SendError: RpcError;
type RecvError: RpcError;
type OpenBiError: RpcError;
type OpenBiFuture<'a, In: RpcMessage, Out: RpcMessage>: Future<Output = Result<(Self::SendSink<Out>, Self::RecvStream<In>), Self::OpenBiError>> + Send + 'a
where
Self: 'a;
type AcceptBiError: RpcError;
type AcceptBiFuture<'a, In: RpcMessage, Out: RpcMessage>: Future<Output = Result<(Self::SendSink<Out>, Self::RecvStream<In>), Self::AcceptBiError>> + Send + 'a
where
Self: 'a;
type ClientChannel<In: RpcMessage, Out: RpcMessage>: ClientChannel<In, Out, Self>;
type ServerChannel<In: RpcMessage, Out: RpcMessage>: ServerChannel<In, Out, Self>;
}
Expand description
Defines a set of types for a kind of channel
Every distinct kind of channel has its own ChannelType. See e.g. crate::transport::MemChannelTypes.
Required Associated Types§
sourcetype SendSink<M: RpcMessage>: Sink<M, Error = Self::SendError> + Send + Unpin + 'static
type SendSink<M: RpcMessage>: Sink<M, Error = Self::SendError> + Send + Unpin + 'static
The sink used for sending either requests or responses on this channel
sourcetype RecvStream<M: RpcMessage>: Stream<Item = Result<M, Self::RecvError>> + Send + Unpin + 'static
type RecvStream<M: RpcMessage>: Stream<Item = Result<M, Self::RecvError>> + Send + Unpin + 'static
The stream used for receiving either requests or responses on this channel
sourcetype OpenBiError: RpcError
type OpenBiError: RpcError
Error you might get when opening a new connection to the server
sourcetype OpenBiFuture<'a, In: RpcMessage, Out: RpcMessage>: Future<Output = Result<(Self::SendSink<Out>, Self::RecvStream<In>), Self::OpenBiError>> + Send + 'a
where
Self: 'a
type OpenBiFuture<'a, In: RpcMessage, Out: RpcMessage>: Future<Output = Result<(Self::SendSink<Out>, Self::RecvStream<In>), Self::OpenBiError>> + Send + 'a
where
Self: 'a
Future returned by open_bi
sourcetype AcceptBiError: RpcError
type AcceptBiError: RpcError
Error you might get when waiting for new streams on the server side
sourcetype AcceptBiFuture<'a, In: RpcMessage, Out: RpcMessage>: Future<Output = Result<(Self::SendSink<Out>, Self::RecvStream<In>), Self::AcceptBiError>> + Send + 'a
where
Self: 'a
type AcceptBiFuture<'a, In: RpcMessage, Out: RpcMessage>: Future<Output = Result<(Self::SendSink<Out>, Self::RecvStream<In>), Self::AcceptBiError>> + Send + 'a
where
Self: 'a
Future returned by accept_bi
sourcetype ClientChannel<In: RpcMessage, Out: RpcMessage>: ClientChannel<In, Out, Self>
type ClientChannel<In: RpcMessage, Out: RpcMessage>: ClientChannel<In, Out, Self>
Channel type
sourcetype ServerChannel<In: RpcMessage, Out: RpcMessage>: ServerChannel<In, Out, Self>
type ServerChannel<In: RpcMessage, Out: RpcMessage>: ServerChannel<In, Out, Self>
Channel type