autotrait2

Crates.ioautotrait2
lib.rsautotrait2
version0.1.1
created_at2025-06-18 12:04:28.008033+00
updated_at2025-06-18 12:10:23.356656+00
descriptiongenerate trait definitions from impl blocks
homepagehttps://github.com/yozhgoor/autotrait2
repositoryhttps://github.com/yozhgoor/autotrait2
max_upload_size
id1716997
size18,673
Yohan Boogaert (yozhgoor)

documentation

https://docs.rs/autotrait2

README

autotrait2

actions status crate version dependencies status licenses

Same as the autotrait crate.

Use this crate if the first one didn't work.

Usage

This crate allow you to define traits without repeating yourself with a trait block.

So you only need the following:

struct Stuff;

#[autotrait2::autotrait]
impl MyTrait for Stuff {
    fn a_trait_function(&self) -> String {
        // ...
    }
}
Commit count: 4

cargo fmt