chinedufn / swift-bridge

swift-bridge facilitates Rust and Swift interop.
https://chinedufn.github.io/swift-bridge
Apache License 2.0
842 stars 62 forks source link

Support Option<Primitive> in Swift fns #203

Closed chinedufn closed 1 year ago

chinedufn commented 1 year ago

This commit adds support for Option in extern "Swift" functions.

For example, the following is now possible:

mod ffi {
    extern "Swift" {
        fn my_func(arg: Option<u8>) -> Option<bool>;
    }
}
chinedufn commented 1 year ago

Thanks!