pub(super) fn try_get_valid_topology_ref(
        &'a self,
        ack_recipient: &Recipient,
        packet_recipient: Option<&Recipient>,
    ) -> Option<&'a NymTopology> {
        // Note: implicit deref with Deref for TopologyReadPermit is happening here
        let topology_ref_option = self.permit.as_ref();
        match topology_ref_option {
            None => None,
            Some(topology_ref) => {
                // see if it's possible to route the packet to both gateways
                if !topology_ref.can_construct_path_through(DEFAULT_NUM_MIX_HOPS)
                    || !topology_ref.gateway_exists(&ack_recipient.gateway())
                    || if let Some(packet_recipient) = packet_recipient {
                        !topology_ref.gateway_exists(&packet_recipient.gateway())
                    } else {
                        false
                    }
                {
                    None
                } else {
                    Some(topology_ref)
                }
            }
        }
    }
/// Using provided topology read permit, tries to get an immutable reference to the underlying
/// topology. For obvious reasons the lifetime of the topology reference is bound to the permit.
Using provided topology read permit, tries to get an immutable reference to the underlying
topology. For obvious reasons the lifetime of the topology reference is bound to the permit.
Using provided topology read permit tries to get an immutable reference to the underlying topology . For obvious reasons the lifetime of the topology reference is bound to the permit .
pub(super) fn try_get_valid_topology_ref(
        &'a self,
        ack_recipient: &Recipient,
        packet_recipient: Option<&Recipient>,
    ) -> Option<&'a NymTopology> {
        // Note: implicit deref with Deref for TopologyReadPermit is happening here
        let topology_ref_option = self.permit.as_ref();
        match topology_ref_option {
            None => None,
            Some(topology_ref) => {
                // see if it's possible to route the packet to both gateways
                if !topology_ref.can_construct_path_through(DEFAULT_NUM_MIX_HOPS)
                    || !topology_ref.gateway_exists(&ack_recipient.gateway())
                    || if let Some(packet_recipient) = packet_recipient {
                        !topology_ref.gateway_exists(&packet_recipient.gateway())
                    } else {
                        false
                    }
                {
                    None
                } else {
                    Some(topology_ref)
                }
            }
        }
    }
pub ( super ) fn try_get_valid_topology_ref ( & ' a self , ack_recipient : & Recipient , packet_recipient : Option < & Recipient > , ) -> Option < & ' a NymTopology > { // Note: implicit deref with Deref for TopologyReadPermit is happening here let topology_ref_option = self . permit . as_ref ( ) ; match topology_ref_option { None => None , Some ( topology_ref ) => { // see if it's possible to route the packet to both gateways if ! topology_ref . can_construct_path_through ( DEFAULT_NUM_MIX_HOPS ) || ! topology_ref . gateway_exists ( & ack_recipient . gateway ( ) ) || if let Some ( packet_recipient ) = packet_recipient { ! topology_ref . gateway_exists ( & packet_recipient . gateway ( ) ) } else { false } { None } else { Some ( topology_ref ) } } } }
Using provided topology read permit, tries to get an immutable reference to the underlying
topology.
Using provided topology read permit tries to get an immutable reference to the underlying topology .
&'a self
ack_recipient
&Recipient
packet_recipient
Option<&Recipient>