Afraid this might have been the case, if Ogeon’s suggestion doesn’t work out, I’ll probably end up with multiple getters, one per type. There aren’t that many anyway
Thank you!
Afraid this might have been the case, if Ogeon’s suggestion doesn’t work out, I’ll probably end up with multiple getters, one per type. There aren’t that many anyway
Thank you!
Correct, I would want the caller to know what they’re getting, I’ll see if this works, Thank you!
SOLUTION:
Here is the solution I came up with:
pub struct Configuration {} impl Configuration { fn get std::str::FromStr>() -> Result { Ok(T::from_str("1234"); } } fn main() { let my_conf_val = Configuration::get(); }