#Is it possible to have a function with the same signature but different trait implementations?

3 messages · Page 1 of 1 (latest)

hexed verge
#

I'm trying to do this

struct CANProxy;
impl CANProxy {
  fn register<T: ReadOnlyThread>(&mut self, thread: T) {
  
  }
  
  fn register<T: ReadWriteThread>(&mut self, thread: T) {
  
  }

Is there a way to do this? Or should I just define different methods

unreal sorrel
#

no, this isn't possible

hexed verge
#

Okay thanks