11 releases (3 stable)

1.0.2 Mar 20, 2023
1.0.1 Jan 27, 2022
1.0.0 Jan 1, 2021
0.2.3 Nov 16, 2020
0.1.2 Nov 5, 2017

#24 in #declare

Download history 1143/week @ 2024-03-14 1170/week @ 2024-03-21 1065/week @ 2024-03-28 717/week @ 2024-04-04 1061/week @ 2024-04-11 1001/week @ 2024-04-18 1055/week @ 2024-04-25 1314/week @ 2024-05-02 1439/week @ 2024-05-09 1192/week @ 2024-05-16 1104/week @ 2024-05-23 1385/week @ 2024-05-30 1388/week @ 2024-06-06 1755/week @ 2024-06-13 1120/week @ 2024-06-20 1469/week @ 2024-06-27

6,054 downloads per month
Used in 21 crates (3 directly)

MIT/Apache

9KB
152 lines

extension-trait

A macro to declare extension traits - a trait that is created to add methods to an external type.

Example

#[macro_use]
extern crate extension_trait;

#[extension_trait]
pub impl DoubleExt for str {
   fn double(&self) -> String {
       self.repeat(2)
   }
}

fn main() {
    assert_eq!("Hello".double(), "HelloHello");
}

Dependencies

~260–710KB
~17K SLoC