pub fn spawn(cluster_nets: Vec<IpNet>, detect_timeout: time::Duration) -> Self {
        let any_authenticated =
            ClientAuthentication::TlsAuthenticated(vec![IdentityMatch::Suffix(vec![])]);

        let all_nets = [IpNet::V4(Default::default()), IpNet::V6(Default::default())];

        let (all_authed_tx, all_authed_rx) = watch::channel(mk_detect_config(
            "_all_authed",
            detect_timeout,
            all_nets.iter().cloned(),
            any_authenticated.clone(),
        ));

        let (all_unauthed_tx, all_unauthed_rx) = watch::channel(mk_detect_config(
            "_all_unauthed",
            detect_timeout,
            all_nets.iter().cloned(),
            ClientAuthentication::Unauthenticated,
        ));

        let (cluster_authed_tx, cluster_authed_rx) = watch::channel(mk_detect_config(
            "_cluster_authed",
            detect_timeout,
            cluster_nets.iter().cloned(),
            any_authenticated,
        ));

        let (cluster_unauthed_tx, cluster_unauthed_rx) = watch::channel(mk_detect_config(
            "_cluster_unauthed",
            detect_timeout,
            cluster_nets.into_iter(),
            ClientAuthentication::Unauthenticated,
        ));

        let (deny_tx, deny_rx) = watch::channel(InboundServer {
            protocol: ProxyProtocol::Detect {
                timeout: detect_timeout,
            },
            authorizations: Default::default(),
        });

        // Ensure the senders are not dropped until all receivers are dropped.
        tokio::spawn(async move {
            tokio::join!(
                all_authed_tx.closed(),
                all_unauthed_tx.closed(),
                cluster_authed_tx.closed(),
                cluster_unauthed_tx.closed(),
                deny_tx.closed(),
            );
        });

        Self {
            all_authed_rx,
            all_unauthed_rx,
            cluster_authed_rx,
            cluster_unauthed_rx,
            deny_rx,
        }
    }
/// Create default allow policy receivers.
///
/// These receivers are never updated. The senders are spawned onto a background task so that
/// the receivers continue to be live. The background task completes once all receivers are
/// dropped.
Create default allow policy receivers.
These receivers are never updated. The senders are spawned onto a background task so that
the receivers continue to be live. The background task completes once all receivers are
dropped.
Create default allow policy receivers . These receivers are never updated . The senders are spawned onto a background task so that the receivers continue to be live . The background task completes once all receivers are dropped .
pub fn spawn(cluster_nets: Vec<IpNet>, detect_timeout: time::Duration) -> Self {
        let any_authenticated =
            ClientAuthentication::TlsAuthenticated(vec![IdentityMatch::Suffix(vec![])]);
        let all_nets = [IpNet::V4(Default::default()), IpNet::V6(Default::default())];
        let (all_authed_tx, all_authed_rx) = watch::channel(mk_detect_config(
            "_all_authed",
            detect_timeout,
            all_nets.iter().cloned(),
            any_authenticated.clone(),
        ));
        let (all_unauthed_tx, all_unauthed_rx) = watch::channel(mk_detect_config(
            "_all_unauthed",
            detect_timeout,
            all_nets.iter().cloned(),
            ClientAuthentication::Unauthenticated,
        ));
        let (cluster_authed_tx, cluster_authed_rx) = watch::channel(mk_detect_config(
            "_cluster_authed",
            detect_timeout,
            cluster_nets.iter().cloned(),
            any_authenticated,
        ));
        let (cluster_unauthed_tx, cluster_unauthed_rx) = watch::channel(mk_detect_config(
            "_cluster_unauthed",
            detect_timeout,
            cluster_nets.into_iter(),
            ClientAuthentication::Unauthenticated,
        ));
        let (deny_tx, deny_rx) = watch::channel(InboundServer {
            protocol: ProxyProtocol::Detect {
                timeout: detect_timeout,
            },
            authorizations: Default::default(),
        });
        // Ensure the senders are not dropped until all receivers are dropped.
        tokio::spawn(async move {
            tokio::join!(
                all_authed_tx.closed(),
                all_unauthed_tx.closed(),
                cluster_authed_tx.closed(),
                cluster_unauthed_tx.closed(),
                deny_tx.closed(),
            );
        });
        Self {
            all_authed_rx,
            all_unauthed_rx,
            cluster_authed_rx,
            cluster_unauthed_rx,
            deny_rx,
        }
    }
pub fn spawn ( cluster_nets : Vec < IpNet > , detect_timeout : time :: Duration ) -> Self { let any_authenticated = ClientAuthentication :: TlsAuthenticated ( vec ! [ IdentityMatch Suffix ( vec [ ] ) ] ) ; let all_nets = [ IpNet :: V4 ( Default :: default ( ) ) , IpNet :: V6 ( Default :: default ( ) ) ] ; let ( all_authed_tx , all_authed_rx ) = watch :: channel ( mk_detect_config ( " " , detect_timeout , all_nets . iter ( ) . cloned ( ) , any_authenticated . clone ( ) , ) ) ; let ( all_unauthed_tx , all_unauthed_rx ) = watch :: channel ( mk_detect_config ( " " , detect_timeout , all_nets . iter ( ) . cloned ( ) , ClientAuthentication :: Unauthenticated , ) ) ; let ( cluster_authed_tx , cluster_authed_rx ) = watch :: channel ( mk_detect_config ( " " , detect_timeout , cluster_nets . iter ( ) . cloned ( ) , any_authenticated , ) ) ; let ( cluster_unauthed_tx , cluster_unauthed_rx ) = watch :: channel ( mk_detect_config ( " " , detect_timeout , cluster_nets . into_iter ( ) , ClientAuthentication :: Unauthenticated , ) ) ; let ( deny_tx , deny_rx ) = watch :: channel ( InboundServer { protocol : ProxyProtocol :: Detect { timeout : detect_timeout , } , authorizations : Default :: default ( ) , } ) ; // Ensure the senders are not dropped until all receivers are dropped. tokio :: spawn ( async move { tokio :: join ! ( all_authed_tx closed ( ) all_unauthed_tx closed ( ) cluster_authed_tx closed ( ) cluster_unauthed_tx closed ( ) deny_tx closed ( ) ) ; } ) ; Self { all_authed_rx , all_unauthed_rx , cluster_authed_rx , cluster_unauthed_rx , deny_rx , } }
Create default allow policy receivers.
Create default allow policy receivers .
cluster_nets
Vec<IpNet>
detect_timeout
time::Duration
cluster_nets
Vec<IpNet>
detect_timeout
time::Duration