1

I'm probably doing something wrong because I cannot think of a good implementation (or alternative) for this pattern in Rust.

trait Terminal {
fn color_manager(&mut self) -> &mut dyn ColorManager;
}

All I want is having things in their own tidy little class with a specific job. In this case handling color conversion, having a registry for indexed colors, stuff like that...

It's composition which Rust should be good at so I assume there's a better way

How can I do something like this properly?

Comments
Add Comment