ops-derive2 0.1.0

Derive macros for implementing the std::ops traits.
Documentation
  • Coverage
  • 0%
    0 out of 11 items documented0 out of 10 items with examples
  • Size
  • Source code size: 10.62 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 319.12 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • akiramusic000

ops-derive2

This is a fork of the ops-derive crate. That crate doesn't support tuple structs, so this crate adds support for those. This crate also adds tests.

Examples

use ops_derive2::*;

#[derive(Debug, PartialEq, AutoAdd)]
pub struct Point(u32, u32, u32);

impl Point {
	pub fn new(x: u32, y: u32, z: u32) -> Self {
		Self(x, y, z)
	}
}

fn main() {
	let a = Point::new(1, 2, 3);
	let b = Point::new(4, 5, 6);
	let c = Point::new(5, 7, 9);

	assert_eq!(a + b, c);
}