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

To/FromGodot has now specific impls for native structs; trait docs #457

Merged
merged 4 commits into from
Oct 20, 2023

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Oct 17, 2023

Changes:

  1. ToGodot + FromGodot had blanket impls for all *mut T and *const T pointers, converting as ints.
    • Potential footgun even if technically safe; it's very easy to get invalid pointers in from_godot() or from_variant(), and this cannot be checked.
    • Only needed because of native structures in godot::engine.
    • Solution: implement ToGodot + FromGodot directly for pointers on those types.
  2. Hide internal FFI- and conversion-related traits and methods from public API.
  3. More documentation around public-facing conversion traits.
  4. Rename left-over godot_compatible module to godot_convert.

@Bromeon Bromeon added documentation Improvements or additions to documentation quality-of-life No new functionality, but improves ergonomics/internals c: core Core components labels Oct 17, 2023
@GodotRust
Copy link

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

@Bromeon Bromeon added this pull request to the merge queue Oct 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 17, 2023
@Bromeon Bromeon force-pushed the qol/conversion-traits-doc branch 3 times, most recently from e8017d5 to 477c527 Compare October 20, 2023 07:57
@Bromeon Bromeon force-pushed the qol/conversion-traits-doc branch from 477c527 to 68610a3 Compare October 20, 2023 07:58
@Bromeon Bromeon enabled auto-merge October 20, 2023 08:02
@Bromeon Bromeon added this pull request to the merge queue Oct 20, 2023
Merged via the queue into master with commit 9de7a8e Oct 20, 2023
14 checks passed
@Bromeon Bromeon deleted the qol/conversion-traits-doc branch October 20, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: core Core components documentation Improvements or additions to documentation 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