Skip to main content

TemporalEntity

Trait TemporalEntity 

Source
pub trait TemporalEntity {
    // Required method
    fn timestamp(&self) -> &Timestamp;

    // Provided methods
    fn time_range(&self) -> TimeRange { ... }
    fn is_within_time_range(&self, range: &TimeRange) -> bool { ... }
}
Expand description

Trait for entities with temporal information.

This trait provides a common interface for anything that has a timestamp, enabling temporal indexing and queries.

Required Methods§

Source

fn timestamp(&self) -> &Timestamp

Returns the primary timestamp of this entity.

Provided Methods§

Source

fn time_range(&self) -> TimeRange

Returns the time range of this entity.

For instantaneous events, this returns a range where start equals end. For entities with duration, this returns the full time span.

Source

fn is_within_time_range(&self, range: &TimeRange) -> bool

Checks if this entity falls within the given time range.

Implementors§