#[swift_bridge::bridge]
mod ffi {
// Export opaque Rust types, functions and methods for Swift to use.
extern "Rust" {
type RingContext;
type IetfProof;
type Input;
type Output;
type Public;
type RingProof;
type Secret;
type IetfVrfSignature;
fn ring_context() -> &'static RingContext;
fn vrf_input_point(vrf_input_data: &[u8]) -> Input;
}
}
I have this setup for a swift package, I want to access a generated function in swift, and have the following error:
I also tried to include generated folder in sources, but it will give lots of errors like error: cannot find '__swift_bridge__$xxx$xxxx' in scope from generated .swift files
Please check if this scenario can be solved, thanks in advance
Problem
I have this setup for a swift package, I want to access a generated function in swift, and have the following error:
It's probably sth wrong with my setup, and I didn't follow https://chinedufn.github.io/swift-bridge/building/swift-packages/index.html as my pacakge later will also need to be run on linux, so I followed https://chinedufn.github.io/swift-bridge/building/swiftc-and-cargo/index.html and tried to make it work in spm
I also tried to include
generated
folder insources
, but it will give lots of errors likeerror: cannot find '__swift_bridge__$xxx$xxxx' in scope
from generated .swift filesPlease check if this scenario can be solved, thanks in advance
Steps
cargo build --target aarch64-apple-darwin