Skip to content

Better tooling around header-translator data files #330

@madsmtm

Description

@madsmtm

In #329 I authored a pretty large file, which naturally lead me to thinking about how that process could be improved upon:

  • Some rustdoc fork that allows one to go through, click a button, and have the source-code updated to mark it as safe (perhaps with a comment).
  • Are property accessors always safe? I know that setters are not, since they may need to maintain an invariant, but it seems like if you have a reference to a type, you should always be able to access any data it holds? Maybe just for certain types (like, we could do NSData: Shared { ... }, and then all NSData properties would become safe).
  • A way to make icrate generate #[method(myMethod)] pub(crate) fn myMethod_unchecked(...) for instances where one would like to modify the method but keep the name the same (e.g. NSData::bytes)
  • Checks in header-translator that verify that the data entry is actually used (and e.g. not declared class X { ... } on a protocol).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frameworkAffects the framework crates and the translator for themhelp wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions