2026-10-07 18:22:30 +02:00
|
|
|
use crate::{Link, Track, Waypoints};
|
2026-09-18 09:03:51 +02:00
|
|
|
|
2026-10-08 19:04:46 +02:00
|
|
|
use super::common::uuid_id;
|
2026-10-02 18:06:45 +02:00
|
|
|
|
2026-10-08 19:04:46 +02:00
|
|
|
uuid_id!(FileId);
|
2026-10-02 18:06:45 +02:00
|
|
|
|
2026-10-08 18:34:19 +02:00
|
|
|
#[derive(Debug, Default, Clone)]
|
2026-10-02 18:06:45 +02:00
|
|
|
pub struct File {
|
|
|
|
|
pub id: FileId,
|
|
|
|
|
pub info: FileInfo,
|
2026-09-18 09:03:51 +02:00
|
|
|
pub trk: Vec<Track>,
|
2026-10-07 18:22:30 +02:00
|
|
|
pub wpt: Waypoints,
|
2026-09-18 09:03:51 +02:00
|
|
|
}
|
|
|
|
|
|
2026-10-08 21:04:29 +02:00
|
|
|
#[derive(Debug, Default, Clone, PartialEq)]
|
2026-10-02 18:06:45 +02:00
|
|
|
pub struct FileInfo {
|
2026-09-18 09:03:51 +02:00
|
|
|
pub name: String,
|
|
|
|
|
pub desc: Option<String>,
|
|
|
|
|
pub author: Option<Author>,
|
2026-10-08 21:13:44 +02:00
|
|
|
pub links: Vec<Link>,
|
2026-09-18 09:03:51 +02:00
|
|
|
pub time: Option<i64>,
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-08 21:04:29 +02:00
|
|
|
#[derive(Debug, Default, Clone, PartialEq)]
|
2026-09-18 09:03:51 +02:00
|
|
|
pub struct Author {
|
|
|
|
|
pub name: Option<String>,
|
2026-10-08 21:13:44 +02:00
|
|
|
/// `id@domain`, which the file gives as the two attributes of an `email` element.
|
2026-09-18 09:03:51 +02:00
|
|
|
pub email: Option<String>,
|
2026-10-08 21:13:44 +02:00
|
|
|
/// The author has a single link, unlike the other elements.
|
2026-09-18 09:03:51 +02:00
|
|
|
pub link: Option<Link>,
|
|
|
|
|
}
|