Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to serialize/deserialize Base<Resource> field #22

Open
StatisMike opened this issue May 12, 2024 · 0 comments
Open

Provide a way to serialize/deserialize Base<Resource> field #22

StatisMike opened this issue May 12, 2024 · 0 comments

Comments

@StatisMike
Copy link
Owner

StatisMike commented May 12, 2024

A method for serde to receive the Base<Resource> field after deserialization

#[derive(GodotClass, Serialize, Deserialize, GdProp)]
#[class(init,base=Resource)]
pub struct TestResource {
    set: HashSet<InnerThing>,
    vec: Vec<InnerThing>,
    #[serde(with="gd_props::serde_gd::base")]
    base: Base<Resource>
}

Or separate derive macro GdPropWithBase

#[derive(GodotClass, Serialize, Deserialize, GdPropWithBase)]
#[class(init,base=Resource)]
pub struct TestResource {
    set: HashSet<InnerThing>,
    vec: Vec<InnerThing>,
    #[serde(with="gd_props::serde_gd::base")]
    base: Base<Resource>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant