You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have a macro that works as the already present macro to load countries, but for querying autonomous system db.
It could be of interest to add the same support in terms of automatic fetching and compression of the latest db version as well, as already done for countries.
The text was updated successfully, but these errors were encountered:
It would be nice to have a macro that works as the already present macro to load countries, but for querying autonomous system db.
It's currently possible to create a DbIpDatabase<Asn> where struct Asn { number: usize, name: String } and impl IpData for Asn { ... }.
I agree that a dedicated macro and Asn in this crate would make it easier, but I think I'd rather create a more general macro. Maybe something like:
use db_ip::{include_database, Asn, DbIpDatabase};
let db: DbIpDatabase<Asn> = include_database!("asn_data.csv", Asn);
If it was a procedural macro, it emit Rust code as opposed to requiring compression/serialization of any kind (or it could just compress/serialize if the Rust code bloated the binary too much).
Anyway, while I'm currently a bit busy, I'll see if I can find some time to add this soon :)
It would be nice to have a macro that works as the already present macro to load countries, but for querying autonomous system db.
It could be of interest to add the same support in terms of automatic fetching and compression of the latest db version as well, as already done for countries.
The text was updated successfully, but these errors were encountered: