pub struct TtlConfig {
pub tombstone_ttl_hours: u32,
pub tombstone_reaping_enabled: bool,
pub days_between_reaping: u32,
pub beacon_ttl: Duration,
pub position_ttl: Duration,
pub capability_ttl: Duration,
pub evict_strategy: EvictionStrategy,
pub offline_policy: Option<OfflineRetentionPolicy>,
}Expand description
TTL configuration for data lifecycle management
Provides collection-specific TTLs and eviction strategies that coordinate with tombstone TTL-based reaping.
Fields§
§tombstone_ttl_hours: u32Tombstone TTL (hours)
Controls how long tombstones persist before being reaped.
tombstone_reaping_enabled: boolEnable automatic tombstone reaping
days_between_reaping: u32Days between tombstone reaping scans (default: 1)
beacon_ttl: DurationBeacon soft-delete TTL (avoids husking)
Beacons are high-churn data. Use soft-delete pattern to mark as deleted rather than creating tombstones.
position_ttl: DurationNode position soft-delete TTL (avoids husking)
capability_ttl: DurationCapability hard-delete TTL
Capabilities are low-churn, coordinated updates. Safe to use hard delete (EVICT).
evict_strategy: EvictionStrategyEVICT strategy for edge devices with storage constraints
offline_policy: Option<OfflineRetentionPolicy>Offline retention policy (optional)
Implementations§
Source§impl TtlConfig
impl TtlConfig
Sourcepub fn tactical() -> TtlConfig
pub fn tactical() -> TtlConfig
Tactical operations preset (high-frequency updates, short TTLs)
Optimized for:
- Rapid beacon discovery (5 min TTL)
- Frequent position updates (10 min TTL)
- Short-lived capabilities (2 hour TTL)
- Offline nodes keep only last 10 items
Sourcepub fn long_duration() -> TtlConfig
pub fn long_duration() -> TtlConfig
Long-duration operations preset (ISR, surveillance)
Optimized for:
- Longer beacon retention (10 min)
- Extended position history (1 hour)
- Long-lived capabilities (48 hours)
Sourcepub fn offline_node() -> TtlConfig
pub fn offline_node() -> TtlConfig
Offline/storage-constrained node preset
Optimized for:
- Minimal storage footprint
- Aggressive local eviction (EVICT, not DELETE)
- Short tombstone TTL (3 days instead of 7)
Sourcepub fn with_beacon_ttl(self, ttl: Duration) -> TtlConfig
pub fn with_beacon_ttl(self, ttl: Duration) -> TtlConfig
Set beacon soft-delete TTL
Sourcepub fn with_position_ttl(self, ttl: Duration) -> TtlConfig
pub fn with_position_ttl(self, ttl: Duration) -> TtlConfig
Set position soft-delete TTL
Sourcepub fn with_capability_ttl(self, ttl: Duration) -> TtlConfig
pub fn with_capability_ttl(self, ttl: Duration) -> TtlConfig
Set capability hard-delete TTL
Sourcepub fn with_eviction(self, strategy: EvictionStrategy) -> TtlConfig
pub fn with_eviction(self, strategy: EvictionStrategy) -> TtlConfig
Set eviction strategy
Sourcepub fn with_offline_policy(self, policy: OfflineRetentionPolicy) -> TtlConfig
pub fn with_offline_policy(self, policy: OfflineRetentionPolicy) -> TtlConfig
Set offline retention policy
Sourcepub fn with_tombstone_ttl(self, hours: u32) -> TtlConfig
pub fn with_tombstone_ttl(self, hours: u32) -> TtlConfig
Set tombstone TTL (hours)
Sourcepub fn get_collection_ttl(&self, collection: &str) -> Option<Duration>
pub fn get_collection_ttl(&self, collection: &str) -> Option<Duration>
Get TTL for a specific collection
Returns the appropriate TTL based on collection name and current configuration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TtlConfig
impl RefUnwindSafe for TtlConfig
impl Send for TtlConfig
impl Sync for TtlConfig
impl Unpin for TtlConfig
impl UnsafeUnpin for TtlConfig
impl UnwindSafe for TtlConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more