pub fn new<Req, Resp, C>(
    config: Config,
    transport: C,
) -> NewClient<Channel<Req, Resp>, RequestDispatch<Req, Resp, C>>
where
    C: Transport<ClientMessage<Req>, Response<Resp>>,
{
    let (to_dispatch, pending_requests) = mpsc::channel(config.pending_request_buffer);
    let (cancellation, canceled_requests) = cancellations();
    let canceled_requests = canceled_requests;

    NewClient {
        client: Channel {
            to_dispatch,
            cancellation,
            next_request_id: Arc::new(AtomicUsize::new(0)),
        },
        dispatch: RequestDispatch {
            config,
            canceled_requests,
            transport: transport.fuse(),
            in_flight_requests: InFlightRequests::default(),
            pending_requests,
        },
    }
}
/// Returns a channel and dispatcher that manages the lifecycle of requests initiated by the
/// channel.
Returns a channel and dispatcher that manages the lifecycle of requests initiated by the
channel.
Returns a channel and dispatcher that manages the lifecycle of requests initiated by the channel .
pub fn new<Req, Resp, C>(
    config: Config,
    transport: C,
) -> NewClient<Channel<Req, Resp>, RequestDispatch<Req, Resp, C>>
where
    C: Transport<ClientMessage<Req>, Response<Resp>>,
{
    let (to_dispatch, pending_requests) = mpsc::channel(config.pending_request_buffer);
    let (cancellation, canceled_requests) = cancellations();
    let canceled_requests = canceled_requests;
    NewClient {
        client: Channel {
            to_dispatch,
            cancellation,
            next_request_id: Arc::new(AtomicUsize::new(0)),
        },
        dispatch: RequestDispatch {
            config,
            canceled_requests,
            transport: transport.fuse(),
            in_flight_requests: InFlightRequests::default(),
            pending_requests,
        },
    }
}
pub fn new < Req , Resp , C > ( config : Config , transport : C , ) -> NewClient < Channel < Req , Resp > , RequestDispatch < Req , Resp , C > > where C : Transport < ClientMessage < Req > , Response < Resp > > , { let ( to_dispatch , pending_requests ) = mpsc :: channel ( config . pending_request_buffer ) ; let ( cancellation , canceled_requests ) = cancellations ( ) ; let canceled_requests = canceled_requests ; NewClient { client : Channel { to_dispatch , cancellation , next_request_id : Arc :: new ( AtomicUsize :: new ( 0 ) ) , } , dispatch : RequestDispatch { config , canceled_requests , transport : transport . fuse ( ) , in_flight_requests : InFlightRequests :: default ( ) , pending_requests , } , } }
Returns a channel and dispatcher that manages the lifecycle of requests initiated by the
channel.
Returns a channel and dispatcher that manages the lifecycle of requests initiated by the channel .
config
Config
transport
C
config
Config
transport
C