![crates-badge] ![docs-badge] ![license-badge] ![rustc-badge]
An attribute macro for easily writing extension trait pattern.
Add this to your Cargo.toml
:
toml
[dependencies]
easy-ext = "0.2"
The current easy-ext requires Rust 1.31 or later.
```rust use easy_ext::ext;
impl
Code like this will be generated:
```rust
pub trait ResultExt
impl
You can elide the trait name. Note that in this case, #[ext]
assigns a random name, so you cannot import/export the generated trait.
```rust use easy_ext::ext;
impl
The visibility of the generated extension trait inherits the visibility of the item in the original impl
.
For example, if the method is pub
then the trait will also be pub
:
```rust use easy_ext::ext;
pub trait ResultExt
impl
See documentation for more details.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.