Hello,
I have a trait which looks like this,
trait Indicator<In, Out> {
fn consume(&mut self, data: &Vec<In>) -> Vec<Out>;
}
I want to implement Add
for all such indicators, such that if the Out
has Add
instance it should just add them
But rust keeps cribbing about I cannot implement traits for arbitrary types if not in the same crate
Also, the In
parameter for arbitrary Indicator
is not constrained. Is there a way to fix that too? Since I can't add PhantomData
field for arbitrary Indicator
_