I am about to start learning Rust after programming in Haskell.
The trait Keyword interested me however I noticed you can only refer to one type (Self).
In Haskell there is a pragma for this behaviour:
{-# LANGUAGE MultiParamTypeClasses #-}
class ExampleBehaviour a b where
combine :: a -> a -> b
co_combine :: b -> b -> a
However I cannot see a way to achive this behaviour organically in Rust.
I think this is what you're looking for:
And here's an example of a Haskell instance of that typeclass and a corresponding Rust implementation of the trait: