-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support returning Result<(), OpaqueRust> from Rust functions (#180)
This commit adds support for returning `Result<(), OpaqueRust>` but not passing as an arg. The change to `examples/rust-binary-calls-swift-package/build.rs` was to support xcode not existing in the default location (I use the `xcodes` tool). This commit also supports empty types, such as `struct UnitStruct()`. This enables the following: ```rust #[swift_bridge::bridge] mod ffi { struct UnitType; extern "Rust" { type OpaqueType; fn null_result() -> Result<(), OpaqueType>; fn unit_result() -> Result<UnitType, OpaqueType>; } } fn null_result() -> Result<(), OpaqueType> { Ok(()) } fn unit_result() -> Result<UnitType, OpaqueType> { Ok(UnitType {}) } ```
- Loading branch information
Showing
13 changed files
with
323 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.