rcman-derive 0.1.3

Derive macros for rcman settings library
Documentation

Derive macros for rcman settings library

This crate provides #[derive(SettingsSchema)] for automatically generating settings schema implementations.

Usage

use rcman::SettingsSchema;

#[derive(SettingsSchema, Default, Serialize, Deserialize)]
#[schema(category = "general")]
struct GeneralSettings {
    tray_enabled: bool,

    #[setting(min = 1024, max = 65535)]
    port: u16,

    #[setting(
        pattern = r"^[\w.-]+@[\w.-]+\.\w+$",
        label = "Email Address"
    )]
    email: String,
}