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

Experiment with splitting up signature differently #1042

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lilizoey
Copy link
Member

@lilizoey lilizoey commented Feb 9, 2025

VarcallSignatureTuple and PtrcallSignatureTuple are now a struct Signature<Params, Ret>. The behavior of the params are in a new set of traits: ParamList, InParamList and OutParamList.

This split allows input parameters and output parameters to be treated differently, for instance this makes it so that only FromGodot is needed for user-defined functions.

Should probably be coordinated with #1000 if we actually want to add it, as both this PR and that PR adds a generic type for parameter tuples.

Currently I've just added the new signature stuff to a separate file, rather than overwriting signature.rs. Mostly to make it easier to read here in the diff and such. This would be changed if we go with this. This needs a lot of cleanup in general lol.

But i wanna at least run the minimal CI on it here and get feedback on if this is the strategy we want to go for before i like polish it up. Since there are other strategies we could go with. The main concrete issue this really solves is splitting up parameters based on if they're in an in vs out call.

I'm not entirely sure if this is a breaking change, i think it isnt? It should just make code that used to not compile, compile. And it doesn't change any public symbols.

@lilizoey lilizoey added feature Adds functionality to the library quality-of-life No new functionality, but improves ergonomics/internals c: ffi Low-level components and interaction with GDExtension API labels Feb 9, 2025
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1042

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: ffi Low-level components and interaction with GDExtension API feature Adds functionality to the library quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants