DrMemCS / drmem

Full source tree for the DrMem control system
MIT License
3 stars 4 forks source link

Refactor/remove `drmem-config` #37

Closed rneswold closed 1 year ago

rneswold commented 1 year ago

Right now the drmem-config crate contains all the types for the .drmem.toml file. Because of this, it contains a mess of conditional compilation blocks to make sure the proper subset is defined.

Although it hasn't happened yet, it seems like someone could install the drmem-config crate with a different set of features than what drmemd uses. This might be more of an issue if/when we get drivers built and loaded as shared libraries.

The drmem-config crate should probably be removed.

Something like:

backend/db-redis-backend/src/config.rs

pub struct StoreConfig {
   ...
}

and in drmemd/src/core.rs

#[cfg(redis-backend)]
use db-redis-backend as store;

#[cfg(not(redis-backend))]
use db-simple-backend as store;

struct Config {
    backend: store::StoreConfig,
}

Drivers use a TOML Map type for their configuration parameters. This definition should be moved to drmem-api::driver.