3 releases (breaking)
Uses old Rust 2015
| 0.10.0 | Feb 2, 2021 |
|---|---|
| 0.8.0 | Mar 31, 2020 |
| 0.5.0 | Dec 8, 2019 |
#11 in #servo-motor
330 downloads per month
Used in 3 crates
(via ev3dev-lang-rust)
4KB
Derive macros for ev3dev_lang_rust
This crate provides some derive macros to simplify the codebase.
The following traits can be automatically derived:
DeviceFindableMotorTachoMotorServoMotorDcMotorSensor
The findable derive needs 3 additional attributes.
class_name: &strdriver_name: &strport: dyn ev3dev_lang_rust::Motor
Example
The functionallity of the LargeMotor struct consists complitly through derives:
#[derive(Debug, Clone, Device, Findable, Motor, TachoMotor)]
#[class_name = "tacho-motor"]
#[driver_name = "lego-ev3-l-motor"]
#[port = "crate::motors::MotorPort"]
pub struct LargeMotor {
driver: Driver,
}
Dependencies
~1.5MB
~39K SLoC