#[derive(StructToString)]
Expand description
The StructToString
macro derives a to_string
function for the struct.
ยงExample
use struct_to_string::StructToString;
#[derive(StructToString)]
struct MyStruct {
field1: i32,
field2: String,
}
let my_struct_as_rust_string = MyStruct::to_rust_string();
// Struct to string can also be used to convert structs to other programming languages,
// including Python, TypeScript, Go, Java, and C#.
let my_struct_as_c_sharp_string = MyStruct::to_csharp_string();