Files
gpx.studio/gpx-rs/engine/src/core/gpx/file.rs
T

36 lines
851 B
Rust
Raw Normal View History

2026-09-23 19:53:39 +02:00
use uuid::Uuid;
2026-10-07 18:22:30 +02:00
use crate::{Link, Track, Waypoints};
2026-09-18 09:03:51 +02:00
2026-10-08 18:34:19 +02:00
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
2026-10-02 18:06:45 +02:00
pub struct FileId(pub Uuid);
impl Default for FileId {
fn default() -> Self {
Self(Uuid::new_v4())
}
}
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 18:34:19 +02:00
#[derive(Debug, Default, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
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-08 18:34:19 +02:00
#[derive(Debug, Default, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2026-09-18 09:03:51 +02:00
pub struct Author {
pub name: Option<String>,
pub email: Option<String>,
pub link: Option<Link>,
}