Struct quic_rpc::transport::combined::ClientChannel
source · pub struct ClientChannel<A: CT, B: CT, In: RpcMessage, Out: RpcMessage> { /* private fields */ }
Expand description
A channel that combines two other channels
Implementations§
source§impl<A: CT, B: CT, In: RpcMessage, Out: RpcMessage> ClientChannel<A, B, In, Out>
impl<A: CT, B: CT, In: RpcMessage, Out: RpcMessage> ClientChannel<A, B, In, Out>
sourcepub fn new(
a: Option<A::ClientChannel<In, Out>>,
b: Option<B::ClientChannel<In, Out>>
) -> Self
pub fn new(
a: Option<A::ClientChannel<In, Out>>,
b: Option<B::ClientChannel<In, Out>>
) -> Self
Create a combined channel from two other channels
When opening a channel with crate::ClientChannel::open_bi
, the first configured channel will be used,
and no attempt will be made to use the second channel in case of failure. If no channels are
configred, open_bi will immediately fail with OpenBiError::NoChannel
.
When listening for incoming channels with crate::ServerChannel::accept_bi
, all configured channels will
be listened on, and the first to receive a connection will be used. If no channels are
configured, accept_bi will wait forever.
Trait Implementations§
source§impl<A: CT, B: CT, In: RpcMessage, Out: RpcMessage> ClientChannel<In, Out, ChannelTypes<A, B>> for ClientChannel<A, B, In, Out>
impl<A: CT, B: CT, In: RpcMessage, Out: RpcMessage> ClientChannel<In, Out, ChannelTypes<A, B>> for ClientChannel<A, B, In, Out>
source§fn open_bi(&self) -> OpenBiFuture<'_, A, B, In, Out>
fn open_bi(&self) -> OpenBiFuture<'_, A, B, In, Out>
Open a bidirectional stream