Releases: chinedufn/swift-bridge
Releases · chinedufn/swift-bridge
0.1.47
0.1.46
-
Support generating a Swift
Equatable
implementation for Rust types that implementPartialEq
. #139 (thanks @NiwakaDev)// For example, the following is now possible: #[swift_bridge::bridge] mod ffi { extern "Rust" { #[swift_bridge(Equatable)] type SomeType; } } #[derive(PartialEq)] struct SomeType;
-
Support generating a Swift
Hashable
implementation for Rust types that implementHash
. #140 (thanks @NiwakaDev)// For example, the following is now possible: #[swift_bridge::bridge] mod ffi { extern "Rust" { #[swift_bridge(Hashable, Equatable)] type SomeType; } } #[derive(Hash, PartialEq)] struct SomeType;
0.1.45
0.1.44
-
Make enums support the
swift_name
attribute. #126// For example, the following is now possible: #[swift_bridge::bridge] mod ffi { #[swift_bridge(swift_name = "EnumRename")] enum EnumName { Variant1, Variant2, } }
-
Fix using the
return_into
attribute an already declared enum. #127// For example, the following is now possible: #[swift_bridge::bridge] mod ffi { #[swift_bridge(already_declared)] enum SomeEnum {} extern "Rust" { #[swift_bridge(return_into)] fn return_into_already_declared() -> SomeEnum; } }
0.1.43
-
Show a spanned compile time error for invalid module items. #124
#[swift_bridge::bridge] mod ffi { use std; fn foo() {} } // error: Only `extern` blocks, structs and enums are supported. // --> tests/ui/invalid-module-item.rs:6:5 // | // 3 | use std; // | ^^^^^^^^ // // error: Only `extern` blocks, structs and enums are supported. // --> tests/ui/invalid-module-item.rs:7:5 // | // 4 | fn foo() {} // | ^^^^^^^^^^^
-
Allow enums to use the
#[already_declared]
attribute. #125// For example, the following is now possible: use some_other_bridge_module::SomeEnum; #[swift_bridge::bridge] mod ffi { #[swift_bridge(already_declared)] enum SomeEnum {} extern "Rust" { fn print(val: SomeEnum); } }
0.1.42
0.1.41
0.1.40
0.1.39: Fix Box<dyn FnOnce> trailing comma (#113)
- Fix compile time error from trailing commas after a boxed
FnOnce
#113// For example, the following is now possible: #[swift_bridge::bridge] mod ffi { extern "Swift" { fn swift_func_takes_callback( // Note the trailing comma after the `FnOnce(..)` arg: Box<dyn FnOnce(Result<SomeRustType, String>), > ); } }
0.1.38
- Add support for
Result<T, E>
#111// For example, the following is now possible: use some_crate::SomeRustType; #[swift_bridge::bridge] mod ffi { extern "Swift" { fn swift_func_takes_callback( arg: Box<dyn FnOnce(Result<SomeRustType, String>)>, ); } extern "Rust" { type SomeRustType; #[swift_bridge::init] fn new () -> SomeRustType; } }