Skip to main content

FlightMetadata

Struct FlightMetadata 

Source
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

Source

pub fn new(igc_hash: Blake3Hex) -> Self

Construct a minimal valid metadata blob with only the required fields.

Source

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 bytes
  • original_filename — the upload filename, if available
  • publisher_node_id — hex-encoded public key of the publishing node
Source

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.

Source

pub fn validate(&self) -> Result<(), MetadataError>

Validate the wire-format constraints for a received metadata blob.

Trait Implementations§

Source§

impl Clone for FlightMetadata

Source§

fn clone(&self) -> FlightMetadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FlightMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FlightMetadata

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for FlightMetadata

Source§

fn eq(&self, other: &FlightMetadata) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for FlightMetadata

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FlightMetadata

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> RpcMessage for T
where T: Debug + Serialize + DeserializeOwned + Send + Sync + Unpin + 'static,