Skip to main content

sample_quality_from_driver

Function sample_quality_from_driver 

Source
pub fn sample_quality_from_driver(quality: Quality) -> SampleQuality
Expand description

Maps the driver’s live bhtune_driver::Quality to the database’s persisted SampleQuality – two separate enums (rather than one shared type) because bhtune-driver and bhtune-db are sibling crates that each depend only on bhtune-core, not on each other; only a crate depending on both needs this mapping, so it lives here rather than forcing a new cross-dependency onto either crate. pub (not just used by [run_polling_loop] below) because bhtune-server’s routes::opc reuses it verbatim for GET /api/opc/read’s quality field, rather than a second copy of the same three-arm match.