Crates.io | in_struct |
lib.rs | in_struct |
version | 1.0.1 |
source | src |
created_at | 2024-04-21 13:02:56.349009 |
updated_at | 2024-04-21 13:27:22.345504 |
description | An attribute-like procedural macro for defining structs for use in functions |
homepage | |
repository | https://github.com/qussaif10/in_struct |
max_upload_size | |
id | 1215350 |
size | 5,953 |
This macro was very useful to me when using actix, instead of making a bunch of structs for each possible json, you can use this macro and simply define the struct with a macro above the functions. To use this macro you can do the following:
use in_struct::define_struct;
#[define_struct(name = Name, derives = [Debug], fields = {field_1: i32, field_2: String})]
fn func(x: Name) {
println!("{:?}", x);
}