Crate prefer_derive

Crate prefer_derive 

Source
Expand description

Derive macros for the prefer configuration library.

This crate provides the #[derive(FromValue)] macro for automatically implementing the FromValue trait on structs and enums.

§Example

use prefer::FromValue;
use prefer_derive::FromValue;

#[derive(FromValue)]
struct ServerConfig {
    host: String,
    port: u16,
    #[prefer(default = "false")]
    debug: bool,
}

Derive Macros§

FromValue
Derive the FromValue trait for a struct or enum.