enum_inject

Crates.ioenum_inject
lib.rsenum_inject
version0.1.4
sourcesrc
created_at2024-10-27 05:45:50.500249
updated_at2024-10-27 13:44:05.566248
descriptionImplement inject For the Enumeration
homepagehttps://github.com/ptechen
repositoryhttps://github.com/ptechen/enum_inject.git
max_upload_size
id1424357
size8,923
Petechen (ptechen)

documentation

https://docs.rs/enum_inject

README

enum_inject

Version info Downloads docs dependency status

example:

    use enum_inject::{enum_injector, EnumInjector};
    use display_enum::Display;
    #[derive(EnumInjector)]
    #[enum_injector({"args":[{"prefix":"A","suffix":"B","compute":{"Mul":1000}},{"prefix":"AA","suffix":"BB","compute":{"Mul":3000}}],"derives":["#[repr(i32)]","#[derive(Display)]"]})]
    enum Foo {
        #[skip]
        Test,
        #[sync_attr]
        B,
        C
    }

    #[test]
    fn test() {
        assert_eq!("ABB", Foo::ABB.to_string());
        assert_eq!(3000, Foo::AABBB as i32);
    }
Commit count: 9

cargo fmt