1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use redis::Client; use serde::Deserialize; #[derive(Clone, Debug, Deserialize)] pub struct RedisConfiguration { pub url: String, } // Allows the configuration to directly create a nats connection impl Into<Client> for RedisConfiguration { fn into(self) -> Client { redis::Client::open(self.url).unwrap() } }