#serialization #structures #nested #macro #generate #complex #helper

yuuka

A helper library to generate complex and nested structures by a simple macro

14 unstable releases (3 breaking)

new 0.4.0 Nov 5, 2024
0.3.7 Nov 1, 2024
0.3.6 Oct 31, 2024
0.2.2 Oct 5, 2024
0.1.1 Oct 2, 2024

#894 in Data structures

Download history 165/week @ 2024-09-26 399/week @ 2024-10-03 544/week @ 2024-10-10 14/week @ 2024-10-17 125/week @ 2024-10-24 390/week @ 2024-10-31

1,232 downloads per month

Apache-2.0

13KB
166 lines

Yuuka

Introduction

This is a helper library to generate complex and nested structures by a simple macro. It is based on the serde library that is used to serialize and deserialize data in Rust.

The name yuuka comes from the character Yuuka in the game Blue Archive.

Quick Start


use serde::{Serialize, Deserialize};
use yuuka::derive_struct;

derive_struct!(
    #[derive(Serialize, Deserialize)]
    GameDevelopment {
        description: String,
        members: Members {
            script_writer: String,
            illustrator: String,
            programmer: String,
            tester: Vec<String>,
        },
        projects: [Project {
            project_name: String,
            engine: String,
        }],
    }
);

let config = GameDevelopment {
    description: "A game development team".to_string(),
    members: Members {
        script_writer: "Momoi".to_string(),
        illustrator: "Midori".to_string(),
        programmer: "Yuzu".to_string(),
        tester: vec!["Arisu".to_string(), "Key".to_string()],
    },
    projects: vec![
        Project {
            project_name: "777 Game Launcher".to_string(),
            engine: "Tauri".to_string(),
        },
        Project {
            project_name: "Blue Archive".to_string(),
            engine: "Unity".to_string(),
        },
    ]
};


Dependencies

~0.6–1.2MB
~26K SLoC