2026-09-18 09:03:51 +02:00
|
|
|
use std::rc::Rc;
|
|
|
|
|
|
2026-09-23 19:53:39 +02:00
|
|
|
use uuid::Uuid;
|
|
|
|
|
|
2026-09-18 09:03:51 +02:00
|
|
|
use crate::gpx::{Link, Track, WaypointChunk};
|
|
|
|
|
|
2026-10-02 18:06:45 +02:00
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
|
|
|
|
pub struct FileId(pub Uuid);
|
|
|
|
|
|
|
|
|
|
impl Default for FileId {
|
|
|
|
|
fn default() -> Self {
|
|
|
|
|
Self(Uuid::new_v4())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Default, PartialEq)]
|
|
|
|
|
pub struct File {
|
|
|
|
|
pub id: FileId,
|
|
|
|
|
pub info: FileInfo,
|
2026-09-18 09:03:51 +02:00
|
|
|
pub trk: Vec<Track>,
|
|
|
|
|
pub wpt: Vec<Rc<WaypointChunk>>,
|
2026-09-21 23:49:57 +02:00
|
|
|
// TODO routes
|
2026-09-18 09:03:51 +02:00
|
|
|
}
|
|
|
|
|
|
2026-10-01 18:42:31 +02:00
|
|
|
#[derive(Debug, Default, 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>,
|
|
|
|
|
pub link: Option<Link>,
|
|
|
|
|
pub time: Option<i64>,
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-01 18:42:31 +02:00
|
|
|
#[derive(Debug, Default, PartialEq)]
|
2026-09-18 09:03:51 +02:00
|
|
|
pub struct Author {
|
|
|
|
|
pub name: Option<String>,
|
|
|
|
|
pub email: Option<String>,
|
|
|
|
|
pub link: Option<Link>,
|
|
|
|
|
}
|