Skip to main content

spatialrust_sync/
stamped.rs

1//! Stamped spatial records for multimodal fusion.
2
3use spatialrust_records::SpatialRecord;
4
5use crate::{StampedTime, TopicId};
6
7/// A spatial record tagged with topic and clocked time.
8#[derive(Clone, Debug, PartialEq)]
9pub struct StampedRecord {
10    /// Logical multimodal topic / channel.
11    pub topic: TopicId,
12    /// Observation time with sync metadata.
13    pub stamp: StampedTime,
14    /// Versioned spatial payload.
15    pub record: SpatialRecord,
16}
17
18impl StampedRecord {
19    /// Creates a stamped record.
20    #[must_use]
21    pub fn new(topic: impl Into<TopicId>, stamp: StampedTime, record: SpatialRecord) -> Self {
22        Self { topic: topic.into(), stamp, record }
23    }
24}