pub fn new<ConnectFut, InitFut, RetryFut>(
        connect: impl Fn(Address) -> ConnectFut + Sync + Send + 'static,
        init: impl Fn(Chan<H, Tx, Rx>) -> InitFut + Sync + Send + 'static,
        retry: impl Fn(Key, Chan<H, Tx, Rx>) -> RetryFut + Sync + Send + 'static,
        session: S,
    ) -> Self
    where
        ConnectFut: Future<Output = Result<(Tx, Rx), ConnectErr>> + Send + 'static,
        InitFut: Future<Output = Result<Key, HandshakeErr>> + Send + 'static,
        RetryFut: Future<Output = Result<(), HandshakeErr>> + Send + 'static,
    {
        Self {
            connect: Arc::new(move |addr| Box::pin(connect(addr))),
            init: Arc::new(move |chan| Box::pin(init(chan))),
            retry: Arc::new(move |key, chan| Box::pin(retry(key, chan))),
            recover_connect: Arc::new(|_, _| Recovery::Fail),
            recover_handshake: Arc::new(|_, _| Recovery::Fail),
            recover_tx: Arc::new(|_, _| Recovery::Fail),
            recover_rx: Arc::new(|_, _| Recovery::Fail),
            timeout: None,
            max_pending_retries: usize::MAX,
            session,
        }
    }
/// Create a new [`Connector`] which connects using the `connect` closure and the specified
/// handshakes, using the `init` handshake when first creating channels, and the `retry`
/// handshake when retrying after errors. All [`Chan`]s returned by this [`Connector`] will have
/// the specified session type.
///
/// All session types implement [`Default`], which means you can pass in a session type `S` to
/// this method by calling `S::default()`.
///
/// By default, a [`Connector`] produces channels with no timeout, no maximum pending retry
/// limit, and will not attempt to retry connections (all errors will immediately propagate).
/// Use its various builder methods to alter these defaults.




By default, a [`Connector`] produces channels with no timeout, no maximum pending retry
limit, and will not attempt to retry connections (all errors will immediately propagate).
Use its various builder methods to alter these defaults.
By default a [ ` Connector ` ] produces channels with no timeout no maximum pending retry limit and will not attempt to retry connections ( all errors will immediately propagate ) . Use its various builder methods to alter these defaults .
pub fn new<ConnectFut, InitFut, RetryFut>(
        connect: impl Fn(Address) -> ConnectFut + Sync + Send + 'static,
        init: impl Fn(Chan<H, Tx, Rx>) -> InitFut + Sync + Send + 'static,
        retry: impl Fn(Key, Chan<H, Tx, Rx>) -> RetryFut + Sync + Send + 'static,
        session: S,
    ) -> Self
    where
        ConnectFut: Future<Output = Result<(Tx, Rx), ConnectErr>> + Send + 'static,
        InitFut: Future<Output = Result<Key, HandshakeErr>> + Send + 'static,
        RetryFut: Future<Output = Result<(), HandshakeErr>> + Send + 'static,
    {
        Self {
            connect: Arc::new(move |addr| Box::pin(connect(addr))),
            init: Arc::new(move |chan| Box::pin(init(chan))),
            retry: Arc::new(move |key, chan| Box::pin(retry(key, chan))),
            recover_connect: Arc::new(|_, _| Recovery::Fail),
            recover_handshake: Arc::new(|_, _| Recovery::Fail),
            recover_tx: Arc::new(|_, _| Recovery::Fail),
            recover_rx: Arc::new(|_, _| Recovery::Fail),
            timeout: None,
            max_pending_retries: usize::MAX,
            session,
        }
    }
pub fn new < ConnectFut , InitFut , RetryFut > ( connect : impl Fn ( Address ) -> ConnectFut + Sync + Send + ' static , init : impl Fn ( Chan < H , Tx , Rx > ) -> InitFut + Sync + Send + ' static , retry : impl Fn ( Key , Chan < H , Tx , Rx > ) -> RetryFut + Sync + Send + ' static , session : S , ) -> Self where ConnectFut : Future < Output = Result < ( Tx , Rx ) , ConnectErr > > + Send + ' static , InitFut : Future < Output = Result < Key , HandshakeErr > > + Send + ' static , RetryFut : Future < Output = Result < ( ) , HandshakeErr > > + Send + ' static , { Self { connect : Arc :: new ( move | addr | Box :: pin ( connect ( addr ) ) ) , init : Arc :: new ( move | chan | Box :: pin ( init ( chan ) ) ) , retry : Arc :: new ( move | key , chan | Box :: pin ( retry ( key , chan ) ) ) , recover_connect : Arc :: new ( | _ , _ | Recovery :: Fail ) , recover_handshake : Arc :: new ( | _ , _ | Recovery :: Fail ) , recover_tx : Arc :: new ( | _ , _ | Recovery :: Fail ) , recover_rx : Arc :: new ( | _ , _ | Recovery :: Fail ) , timeout : None , max_pending_retries : usize :: MAX , session , } }
Create a new [`Connector`] which connects using the `connect` closure and the specified
handshakes, using the `init` handshake when first creating channels, and the `retry`
handshake when retrying after errors.
Create a new [ ` Connector ` ] which connects using the ` connect ` closure and the specified handshakes using the ` init ` handshake when first creating channels and the ` retry ` handshake when retrying after errors .
connect
impl Fn(Address) -> ConnectFut + Sync + Send + 'static
init
impl Fn(Chan<H, Tx, Rx>) -> InitFut + Sync + Send + 'static
retry
impl Fn(Key, Chan<H, Tx, Rx>) -> RetryFut + Sync + Send + 'static
session
S