dtolnay/request-for-implementation

a procedural macro for creating extension traits

nikomatsakis opened this issue · 2 comments

I would like a macro where

#[private_extension(Foo)]
impl SomeExternalType {
    fn method(&self) { ... }
}

would expand to

trait Foo {
    fn method(&self);
}

impl Foo for SomeExternalType { ..  }

I think easy-ext is the crate for this.

Yep, that looks like it. Thanks! https://crates.io/crates/extend is another implementation.