sensor-db 0.1.0

Append-only sensor database for NOR flash on embedded devices
Documentation
//! Ports: capabilities the spooler needs from the outside world.
//!
//! This module is pure — no I/O, no feature gates, no driver types. It compiles
//! with zero features enabled.

/// A storage volume that can physically go away.
///
/// Implemented by removable-media drivers (SD sockets with a card-detect line,
/// SDIO controllers, hot-pluggable SPI flash carriers). The spooler consults it
/// before starting a batch and treats `false` as a clean detach, which lets a
/// driver that *knows* the medium is gone avoid the alternative: discovering it
/// through a failed write.
///
/// # Why this is not blanket-implemented
///
/// A blanket `impl<T> Removable for T { fn is_present(&self) -> bool { true } }`
/// would be un-overridable — the very drivers that can answer honestly would be
/// unable to. Instead, `Removable` is opt-in: the spooler's core API requires
/// only `NorFlash + ReadNorFlash`, and a separate impl block bounded on
/// `+ Removable` offers the presence-aware methods on top.
///
/// # Contract
///
/// `is_present` must not perform I/O that can block for long or fail. It reports
/// what the driver already knows (a GPIO level, a cached detect state). Returning
/// `true` is never a promise that the next write will succeed — it only means the
/// driver has no positive evidence of absence.
pub trait Removable {
    /// Returns `true` while the medium is believed present and usable.
    fn is_present(&self) -> bool;
}