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

Apply input module visibility to output module #284

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

jnbooth
Copy link
Contributor

@jnbooth jnbooth commented Jul 29, 2024

Addresses #252.

Here's an example of using this.

// enums.rs

#[swift_bridge::bridge]
pub mod ffi {
    enum MyEnum {
        VariantA,
        VariantB,
        VariantC,
    }
}

// lib.rs
mod enums;
use enums::ffi::MyEnum;

#[swift_bridge::bridge]
mod ffi {
  #[swift_bridge(already_declared)]
  enum MyEnum {}

  extern "Rust" {
    fn getEnum() -> MyEnum;
  }
}

Copy link
Owner

@chinedufn chinedufn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks.

Please just update the PR body to show an example of a bridge module that:

  1. was not possible before this PR
  2. is now possible as of this PR

Example: #211


We use these examples:

  • when writing release notes
  • when linking new contributors to old PRs to use as inspiration
  • for anyone that watches the repo to be able to get a quick sense of new changes without needing to read code

Once the PR body is updated we can land this.

Can just do

This commit ... what it does ...

For example, the following is now possible:

EXAMPLE BRIDGE MODULE HERE

@jnbooth
Copy link
Contributor Author

jnbooth commented Jul 30, 2024

@chinedufn Done. Thank you for providing the example!

@chinedufn
Copy link
Owner

Ooo nice example.

Thanks for submitting and landing your first contribution!

@chinedufn chinedufn merged commit 37ac2c2 into chinedufn:master Jul 30, 2024
2 of 5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants