nym-exit-policy 1.20.5

Get and set the Nym Exit Policy, used by Exit Gateways
Documentation
1
2
3
4
5
6
7
8
9
10
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0

use crate::ExitPolicy;
use crate::policy::PolicyError;
use reqwest::IntoUrl;

pub async fn get_exit_policy(url: impl IntoUrl) -> Result<ExitPolicy, PolicyError> {
    ExitPolicy::parse_from_torrc(reqwest::get(url).await?.text().await?)
}