1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
#[derive(Debug, Clone, Default)] pub struct Options { api_key: &'static str, secret_key: &'static str, base_url: &'static str, } impl Options { pub fn new() -> Options { Options::default() } pub fn api_key(&self) -> &'static str { &self.api_key } pub fn secret_key(&self) -> &'static str { &self.secret_key } pub fn base_url(&self) -> &'static str { &self.base_url } pub fn set_api_key(&mut self, api_key: &'static str) { self.api_key = api_key; } pub fn set_secret_key(&mut self, secret_key: &'static str) { self.secret_key = secret_key; } pub fn set_base_url(&mut self, base_url: &'static str) { self.base_url = base_url; } }