Skip to content

KamilaBorowska/extension-trait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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");
}

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages