extension-trait

Crates.ioextension-trait
lib.rsextension-trait
version1.0.2
sourcesrc
created_at2017-11-04 22:11:48.63058
updated_at2023-03-20 15:10:11.163878
descriptionMacro to declare extension traits
homepage
repositoryhttps://gitlab.com/KonradBorowski/extension-trait
max_upload_size
id38167
size23,693
Kamila Borowska (xfix)

documentation

https://docs.rs/extension-trait

README

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");
}
Commit count: 65

cargo fmt