Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
single9 committed Jul 12, 2024
1 parent 0a6e2f8 commit 3380452
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/ip_geo_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,32 @@ impl IpGeoClient {
///
/// # Examples
///
/// ```
/// ## MMDB
///
/// ```no_run
/// use dns_geolocation_checker::ip_geo_client::{IpGeoClient, IpGeoProviderType};
/// use dns_geolocation_checker::ip_geo_client::mmdb_client::MMDBClient;
/// use dns_geolocation_checker::ip_geo_client::ip_api_client::IpApiClient;
/// use dns_geolocation_checker::configs_parser::Config;
///
/// let config = Config::default();
/// let mmdb_client = IpGeoClient::with_provider::<MMDBClient>(&config);
/// let ipapi_client = IpGeoClient::with_provider::<IpApiClient>(&config);
///
/// assert_eq!(mmdb_client.get_provider_type(), IpGeoProviderType::MMDB.to_string());
/// ```
///
/// ## IP-API
///
/// ```no_run
/// use dns_geolocation_checker::ip_geo_client::{IpGeoClient, IpGeoProviderType};
/// use dns_geolocation_checker::ip_geo_client::ip_api_client::IpApiClient;
/// use dns_geolocation_checker::configs_parser::Config;
///
/// let config = Config::default();
/// let ipapi_client = IpGeoClient::with_provider::<IpApiClient>(&config);
///
/// assert_eq!(ipapi_client.get_provider_type(), IpGeoProviderType::IpApi.to_string());
/// ```
///
pub fn with_provider<T>(config: &Config) -> IpGeoProvider<T>
where
T: GetGeoIpInfo + NewProvider + Clone,
Expand Down

0 comments on commit 3380452

Please sign in to comment.