Crate flydent

Crate flydent 

Source
Expand description

§Flydent

A Rust library for parsing aircraft registration callsigns and ICAO 24-bit identifiers. This is a port of the Python flydenity library that identifies countries and organizations from aircraft callsigns using ITU data.

§Features

  • Parse aircraft callsigns (e.g., “T6ABC” -> Afghanistan)
  • Parse ICAO 24-bit identifiers (e.g., “700123” -> Afghanistan)
  • Identify countries with ISO codes and organizations
  • Compile-time CSV parsing for zero-runtime overhead
  • No external CSV files required at runtime

§Usage

use flydent::{Parser, EntityResult};

let parser = Parser::new();

// Parse a callsign
if let Some(result) = parser.parse_simple("T6ABC") {
    match result {
        EntityResult::Country { nation, iso2, .. } => {
            println!("Country: {} ({})", nation, iso2);
        }
        EntityResult::Organization { name, .. } => {
            println!("Organization: {}", name);
        }
    }
}

// Parse ICAO 24-bit identifier
if let Some(result) = parser.parse("700123", false, true) {
    println!("ICAO identifier parsed: {:?}", result);
}

Modules§

icao
registration

Structs§

Parser

Enums§

EntityResult