I think what I want is specialization in Rust. But I'm not sure if that's actually what I want. E.g. I want to be able to define some method. But then if certain conditions apply define a different, more efficient method with the same signature. That's... specialization right?
s/write to/choose/ E.g. fn foo() -> Result<(), Box<dyn Error>> {} It means we don't know statically which error we might get back, but we guarantee it'll implement the Error trait. Less efficient, but super useful when you need it.