How to share immutable configuration data with hyper request handlers?
问题 I am trying to develop a hyper based server application in Rust. There is an INI file holding configuration like binding IP, database and so on. I don't want to parse the INI file on each request and it is OK to keep the configuration data until server restart. How can I give a struct of already parsed data to the request handler? I have tried several approaches like using std::sync::Arc , but the only thing working so far is to use a static , but I want to avoid unsafe blocks. Here is a