pub struct FlightMetadata {Show 23 fields
pub schema: String,
pub schema_version: u32,
pub igc_hash: Blake3Hex,
pub original_filename: Option<String>,
pub flight_date: Option<String>,
pub started_at: Option<String>,
pub ended_at: Option<String>,
pub duration_s: Option<u64>,
pub pilot_name: Option<String>,
pub glider_type: Option<String>,
pub glider_id: Option<String>,
pub device_id: Option<String>,
pub fix_count: Option<u32>,
pub valid_fix_count: Option<u32>,
pub bbox: Option<BoundingBox>,
pub launch_lat: Option<f64>,
pub launch_lon: Option<f64>,
pub landing_lat: Option<f64>,
pub landing_lon: Option<f64>,
pub max_alt_m: Option<i32>,
pub min_alt_m: Option<i32>,
pub publisher_node_id: Option<NodeIdHex>,
pub published_at: Option<String>,
}Expand description
igc-net metadata blob (schema_version 1).
Serialises to/from the JSON wire format defined in specs_meta.md §2.
Optional fields absent from the struct MUST be omitted from JSON (not null)
— enforced by #[serde(skip_serializing_if = "Option::is_none")].
Fields§
§schema: String§schema_version: u32§igc_hash: Blake3Hex§original_filename: Option<String>§flight_date: Option<String>§started_at: Option<String>§ended_at: Option<String>§duration_s: Option<u64>§pilot_name: Option<String>§glider_type: Option<String>§glider_id: Option<String>§device_id: Option<String>§fix_count: Option<u32>§valid_fix_count: Option<u32>Count of B records with validity flag ‘A’. Always ≤ fix_count.
bbox: Option<BoundingBox>§launch_lat: Option<f64>§launch_lon: Option<f64>§landing_lat: Option<f64>§landing_lon: Option<f64>§max_alt_m: Option<i32>§min_alt_m: Option<i32>§publisher_node_id: Option<NodeIdHex>§published_at: Option<String>Implementations§
Source§impl FlightMetadata
impl FlightMetadata
Sourcepub fn new(igc_hash: Blake3Hex) -> Self
pub fn new(igc_hash: Blake3Hex) -> Self
Construct a minimal valid metadata blob with only the required fields.
Sourcepub fn from_igc_bytes(
igc_bytes: &[u8],
igc_hash: Blake3Hex,
original_filename: Option<&str>,
publisher_node_id: Option<NodeIdHex>,
) -> Self
pub fn from_igc_bytes( igc_bytes: &[u8], igc_hash: Blake3Hex, original_filename: Option<&str>, publisher_node_id: Option<NodeIdHex>, ) -> Self
Parse IGC headers and B-records to build a fully-populated metadata blob.
Falls back gracefully: if a field cannot be parsed it is omitted rather than causing an error. Only requires at least one B-record to be present.
§Arguments
igc_bytes— raw IGC file bytes (unmodified)igc_hash— pre-computed BLAKE3 hex string of those bytesoriginal_filename— the upload filename, if availablepublisher_node_id— hex-encoded public key of the publishing node
Sourcepub fn to_blob_bytes(&self) -> Result<Vec<u8>, MetadataError>
pub fn to_blob_bytes(&self) -> Result<Vec<u8>, MetadataError>
Serialize to canonical UTF-8 JSON bytes (no BOM, no trailing newline).
These bytes are what get content-addressed as the metadata blob.
Sourcepub fn validate(&self) -> Result<(), MetadataError>
pub fn validate(&self) -> Result<(), MetadataError>
Validate the wire-format constraints for a received metadata blob.
Trait Implementations§
Source§impl Clone for FlightMetadata
impl Clone for FlightMetadata
Source§fn clone(&self) -> FlightMetadata
fn clone(&self) -> FlightMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more