to-values-derive 0.1.0

Derive macro for the to-values crate.
Documentation

to-values-derive

This is the derive-macro companion to to-values. It is re-exported by to-values when that crate's default derive feature is enabled, so applications normally only need to depend on to-values.

use to_values::ToInputVector;

#[derive(ToInputVector)]
struct Observation {
    position: [f32; 2],
    #[input(skip)]
    id: u64,
    active: bool,
}

The macro supports named, tuple, unit, and generic structs. It flattens fields in declaration order and adds the required ToInputVector bounds. Use #[input(skip)] to exclude a field.

License

Licensed under the MIT License.