jhugman / uniffi-bindgen-react-native

A uniffi bindings generator for calling Rust from react-native
Other
0 stars 0 forks source link

Implement non-flat errors #38

Closed jhugman closed 1 month ago

jhugman commented 1 month ago

According to The Big O of Code Reviews, this is a O(n) change.

Rust does not have checked exceptions, instead uses a general purpose Result<T, E> enum.

Where E is a simple enum, uniffi calls this a "flat errror".

Where E to be an enum with associated values, uniffi calls this a "non-flat error".

This PR re-implements the generation of errors for typescript, so as to enable non-flat errors.

As part of this work: