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

Add #[swift_bridge(Sendable)] attribute #317

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

chinedufn
Copy link
Owner

This commit introduces a new #[swift_bridge(Sendable)]
attribute that emits Swift Sendable implementations for opaque
Rust types, and Rust Send + Sync implementations for opaque
Swift types.

These implementations are checked at compile time.

Example usage:

mod ffi {
    extern "Rust" {
        #[swift_bridge(Sendable)]
        type MyRustType;
    }

    extern "Swift" {
        #[swift_bridge(Sendable)]
        type MySwiftType;
    }
}

@chinedufn chinedufn force-pushed the extern-swift-sendable-attribute branch from 258faa8 to 0b64dd6 Compare February 4, 2025 17:02
This commit introduces a new `#[swift_bridge(Sendable)]`
attribute that emits Swift `Sendable` implementations for opaque
Rust types, and Rust `Send + Sync` implementations for opaque
Swift types.

These implementations are checked at compile time.

Example usage:
```rust
mod ffi {
    extern "Rust" {
        #[swift_bridge(Sendable)]
        type MyRustType;
    }

    extern "Swift" {
        #[swift_bridge(Sendable)]
        type MySwiftType;
    }
}
```
@chinedufn chinedufn force-pushed the extern-swift-sendable-attribute branch from 0b64dd6 to 5cc975e Compare February 4, 2025 17:05
@chinedufn chinedufn merged commit 4827500 into master Feb 4, 2025
5 checks passed
@chinedufn chinedufn deleted the extern-swift-sendable-attribute branch February 4, 2025 17:24
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.

1 participant