ForyObject

Derive Macro ForyObject 

Source
#[derive(ForyObject)]
{
    // Attributes available to this derive:
    #[fory_debug]
}
Expand description

Derive macro for object serialization.

This macro generates code to implement the Serializer trait for the annotated type, enabling full object graph serialization with reference handling and cross-language compatibility.

ยงExample

use fory_derive::ForyObject;

#[derive(ForyObject, Debug, PartialEq)]
struct Person {
    name: String,
    age: i32,
    address: Address,
}

#[derive(ForyObject, Debug, PartialEq)]
struct Address {
    street: String,
    city: String,
}