nodedb 0.0.0-beta.1

Local-first, real-time, edge-to-cloud hybrid database for multi-modal workloads
Documentation
pub mod engine;
mod engine_helpers;
mod engine_index;
mod engine_stats;
pub mod entry;
pub mod expiry_wheel;
mod hash_helpers;
pub mod hash_table;
pub mod index;
pub mod scan;
pub mod slab;

pub use engine::KvEngine;
pub use engine_stats::{ExpiredKey, KvStats};

/// Get current wall-clock time in milliseconds since Unix epoch.
///
/// Used by KV engine handlers and the core loop for TTL calculations.
/// Returns 0 on clock failure (extremely rare, only on broken systems).
pub fn current_ms() -> u64 {
    std::time::SystemTime::now()
        .duration_since(std::time::UNIX_EPOCH)
        .map(|d| d.as_millis() as u64)
        .unwrap_or(0)
}