Skip to content

0.1.48

Compare
Choose a tag to compare
@chinedufn chinedufn released this 29 Jan 19:37
· 70 commits to master since this release
5428646
  • Support returning Result<T, E> where T and E are opaque Rust types. #149

    // For example, the following is now possible:
    
    #[swift_bridge::bridge]
    mod ffi {
        extern "Rust" {
            type TypeA;
            type TypeB;
    
            fn some_function() -> Result<TypeA, TypeB>;
    
            fn print_info(self: &TypeB);
        }
    }
    // Swift
    
    do {
        let typeA = try some_function()
    } catch let typeB as TypeB {
        typeB.print_info()
    }
  • Support Option<Vec<T>> where T is a primitive type. #147 (thanks @NiwakaDev)

    // For example, the following is now possible:
    
    #[swift_bridge::bridge]
    mod ffi {
        extern "Rust" {
            fn some_function(arg: Option<Vec<u8>>) -> Option<Vec<i64>>;
        }
    }
  • Optimize RustStr's Swift Equatable protocol implementation. #151 (thanks @NiwakaDev)

  • Add compile time error messages for invalid args_into attributes. #145 (thanks @NiwakaDev)