enum_from_derive

Crates.ioenum_from_derive
lib.rsenum_from_derive
version0.1.6
sourcesrc
created_at2024-08-22 06:11:55.462066
updated_at2024-11-15 07:23:42.71216
descriptionImplement From For the Enumeration
homepagehttps://github.com/ptechen
repositoryhttps://github.com/ptechen/enum_from_derive.git
max_upload_size
id1347311
size11,780
Petechen (ptechen)

documentation

https://docs.rs/enum_from_derive

README

enum_from_derive

Version info Downloads docs dependency status

example:

    use enum_from_derive::From;

    #[repr(i32)]
    #[derive(From, Debug)]
    pub enum Test {
        #[default]
        Name,
        #[from_str(test)]
        #[False]
        Test = 100,
        #[False]
        TTT,
        #[True]
        FFF = 1000
    }

    #[test]
    fn test() {
        let t = Test::from("test1");
        println!("{:?}", t);
        let t = Test::from(100);
        println!("{:?}", t);
        println!("{}", a.to_bool())
    }


Commit count: 11

cargo fmt