glissade-macro

Crates.ioglissade-macro
lib.rsglissade-macro
version0.1.2
sourcesrc
created_at2024-06-24 04:45:08.277521
updated_at2024-07-19 19:00:01.387563
descriptionDerive macro for implementing glissade::Mix trait
homepage
repositoryhttps://github.com/monkin/glissade
max_upload_size
id1281818
size5,704
Andrey Monkin (monkin)

documentation

README

Glissade macro

Glissade macro is a Rust crate that provides Mix derive macro for the glissade library.

See the https://github.com/monkin/glissade for more information.

Usage

use glissade::Mix;

#[derive(Mix, PartialEq, Debug)]
struct Touch {
    x: f32,
    y: f32,
    pressure: u8,
}

let touch1 = Touch { x: 0.0, y: 0.0, pressure: 0 };
let touch2 = Touch { x: 100.0, y: 100.0, pressure: 200 };
let touch_mix = touch1.mix(touch2, 0.5);

assert_eq!(touch_mix, Touch { x: 50.0, y: 50.0, pressure: 100 });

License

This project is licensed under the MIT License.

Commit count: 184

cargo fmt