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

#48 in #motor

Download history 54/week @ 2024-07-22 48/week @ 2024-07-29 23/week @ 2024-08-05 27/week @ 2024-08-12 21/week @ 2024-08-19 34/week @ 2024-08-26 15/week @ 2024-09-02 19/week @ 2024-09-09 21/week @ 2024-09-16 44/week @ 2024-09-23 18/week @ 2024-09-30 1/week @ 2024-10-07 19/week @ 2024-10-14 13/week @ 2024-10-21 29/week @ 2024-10-28 25/week @ 2024-11-04

86 downloads per month
Used in 2 crates (via ev3dev-lang-rust)

MIT license

4KB

Derive macros for ev3dev_lang_rust

Build Status Latest version

This crate provides some derive macros to simplify the codebase.

The following traits can be automatically derived:

  • Device
  • Findable
  • Motor
  • TachoMotor
  • ServoMotor
  • DcMotor
  • Sensor

The findable derive needs 3 additional attributes.

  • class_name: &str
  • driver_name: &str
  • port: 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
~37K SLoC