config.rs 387 B

12345678910111213141516171819202122
  1. use crate::{status::StatusManager, storage::Storage};
  2. #[derive(Debug)]
  3. pub struct Config<S>
  4. where
  5. S: Storage + Sync + Send,
  6. {
  7. pub storage: S,
  8. pub status: StatusManager,
  9. }
  10. impl<S> From<S> for Config<S>
  11. where
  12. S: Storage + Sync + Send,
  13. {
  14. fn from(storage: S) -> Self {
  15. Self {
  16. storage,
  17. status: StatusManager::default(),
  18. }
  19. }
  20. }