bendk

Results 297 comments of bendk

> @bendk Thanks for the comment! For now, we only need to alter the metadata parsing logic, so a helper function similar to uniffi_bindgen::library_mode::generate_bindings with an option to customize that...

> It would be trivial if the code range that needs rewriting and and maintaining is confined to uniffi_bindgen/src/library_mode.rs. Would I need to maintain our own uniffi_bindgen/src/lib.rs (for uniffi_bindgen::generate_external_bindings for...

I just rebased this branch, we'll see what happens with `generic-array`. I think it'll be okay in app-services, because we're using `0.14.5` in our lock file. However, we may hit...

Objects always need to be wrapped in Arc so I think you want something like: ``` #[cfg(feature = "uniffi-bindings")] uniffi::custom_type!(ArcError, Arc, { remote, try_lift: |val| Ok(Arc::new(AnyError { inner: val })),...

I tried to make this work over the weekend with the library metadata loader and it wasn't so easy. There's 2 issues there: it's not clear where to find dependency...

This feels like it should language-specific to me since Rust doesn't really support type unions. Could [bindings custom types](https://mozilla.github.io/uniffi-rs/latest/types/custom_types.html#custom-types-in-the-bindings-code) work for this? You could write Python `lift` and `lower` functions...

Nice! It seems like it's sort-of working already. IMO, a big improvement would be to not require the custom type code in Rust. Do you get an error if you...

> We need the two different types because we still need the type that uniffi knows how to lift/lower (unless we have some mechnism to lift/lower directly from a RustBuffer,...

> Yeah definitely. I was thinking it should be configurable globally (all enums that are union-capable are made into unions), but do you think it should be configurable per-type? Great...

Currently, that module name is controlled by the `ffi_module_name` field of the [config file](https://mozilla.github.io/uniffi-rs/latest/swift/configuration.html). [Here's how we set it in our crates](https://github.com/mozilla/application-services/blob/149f6e099f5b10770ce6a2a9c257894b84218857/components/logins/uniffi.toml#L5). If you set the field in `uniffi.toml` does...