pub fn random_route_to_gateway<R>(
        &self,
        rng: &mut R,
        num_mix_hops: u8,
        gateway_identity: &NodeIdentity,
    ) -> Result<Vec<SphinxNode>, NymTopologyError>
    where
        // I don't think there's a need for this RNG to be crypto-secure
        R: Rng + ?Sized,
    {
        let gateway = self
            .get_gateway(gateway_identity)
            .ok_or(NymTopologyError::NonExistentGatewayError)?;

        Ok(self
            .random_mix_route(rng, num_mix_hops)?
            .into_iter()
            .chain(std::iter::once(gateway.into()))
            .collect())
    }
/// Tries to create a route to the specified gateway, such that it goes through mixnode on layer 1,
/// mixnode on layer2, .... mixnode on layer n and finally the target gateway
Tries to create a route to the specified gateway, such that it goes through mixnode on layer 1,
mixnode on layer2, .... mixnode on layer n and finally the target gateway
Tries to create a route to the specified gateway such that it goes through mixnode on layer 1 mixnode on layer2 .... mixnode on layer n and finally the target gateway
pub fn random_route_to_gateway<R>(
        &self,
        rng: &mut R,
        num_mix_hops: u8,
        gateway_identity: &NodeIdentity,
    ) -> Result<Vec<SphinxNode>, NymTopologyError>
    where
        // I don't think there's a need for this RNG to be crypto-secure
        R: Rng + ?Sized,
    {
        let gateway = self
            .get_gateway(gateway_identity)
            .ok_or(NymTopologyError::NonExistentGatewayError)?;
        Ok(self
            .random_mix_route(rng, num_mix_hops)?
            .into_iter()
            .chain(std::iter::once(gateway.into()))
            .collect())
    }
pub fn random_route_to_gateway < R > ( & self , rng : & mut R , num_mix_hops : u8 , gateway_identity : & NodeIdentity , ) -> Result < Vec < SphinxNode > , NymTopologyError > where // I don't think there's a need for this RNG to be crypto-secure R : Rng + ? Sized , { let gateway = self . get_gateway ( gateway_identity ) . ok_or ( NymTopologyError :: NonExistentGatewayError ) ? ; Ok ( self . random_mix_route ( rng , num_mix_hops ) ? . into_iter ( ) . chain ( std :: iter :: once ( gateway . into ( ) ) ) . collect ( ) ) }
Tries to create a route to the specified gateway, such that it goes through mixnode on layer 1,
mixnode on layer2, .... mixnode on layer n and finally the target gateway
Tries to create a route to the specified gateway such that it goes through mixnode on layer 1 mixnode on layer2 .... mixnode on layer n and finally the target gateway
&self
rng
&mut R
num_mix_hops
u8
gateway_identity
&NodeIdentity
&self
rng
&mut R
num_mix_hops
u8
gateway_identity
&NodeIdentity