nesting 0.1.0

Nesting structs, enums, and impls, in Rust!
Documentation

Nesting

Nesting is a Rust proc-macro library for defining structs, enums, and impls in a nested fashion.

Ideal for writing configs or heavily-nested data structures.

Example

nesting::nest! {
	#![derive(Debug)]

    struct MyStruct {
        child: MyChildStruct

        struct MyChildStruct {
            is_nested: bool,

            impl Default for MyChildStruct {
                fn default() -> Self {
                    Self { is_nested: true}
                }
            }
        }
    }
}

fn main() {
	let x = MyStruct {
		child: MyChildStruct::default(),
	};

	dbg!(&x);
}

Check out the docs for more info or take a look at nesting-examples for a more detailed example.