derive-cmp-ops

Crates.ioderive-cmp-ops
lib.rsderive-cmp-ops
version0.1.0
sourcesrc
created_at2024-04-17 06:12:15.674549
updated_at2024-04-17 06:12:15.674549
descriptionDerives for componetwise opperations
homepage
repositoryhttps://github.com/abss-witch/derive-ops/
max_upload_size
id1211072
size12,818
abyss-witch (abss-witch)

documentation

README

Custom derive macros to implement component wise opperations.

use derive_cmp_ops::CmpOps;
#[derive(CmpOps)]
struct Point{
    a: f32,
    b: i8,
    c: i16
}

Alternatively you can include individual opperations.

use derive_cmp_ops::{CmpRemAssign, CmpMul};
#[derive(CmpRemAssign, CmpMul)]
struct Point{
    a: f32,
    b: i8,
    c: i16
}

Includes derives for add, add assign, sub, sub assign, mul, mul assign, div, div assign, rem, rem assign and neg

Commit count: 16

cargo fmt