You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JNI does not support returning the generic types so Result<T> cannot be returned from bindings. JNI bindings can only return Java values. The solution implemented in #61 throws exception when a result type is an error. However, there might be a way to return Kotlin/functional style Result values from JNI bindings which will give a more ergonomic API.
Since JNI only allows Java types a Kotlin Result type is not supported directly. However, it is possible to create a Java Result class that mimics a Kotlin Result type.1 To use this it will need to be defined and loaded into the JNIEnv2 so that the Java Result object can be created and filled with the appropriate value.
The result will be a more ergonomic and functional style Java bindings to the fs-storage crate.
JNI does not support returning the generic types so
Result<T>
cannot be returned from bindings. JNI bindings can only return Java values. The solution implemented in #61 throws exception when a result type is an error. However, there might be a way to return Kotlin/functional style Result values from JNI bindings which will give a more ergonomic API.Since JNI only allows Java types a Kotlin Result type is not supported directly. However, it is possible to create a Java
Result
class that mimics a KotlinResult
type.1 To use this it will need to be defined and loaded into the JNIEnv2 so that the Java Result object can be created and filled with the appropriate value.The result will be a more ergonomic and functional style Java bindings to the fs-storage crate.
Footnotes
https://stackoverflow.com/q/60626607 ↩
https://stackoverflow.com/q/67818417 ↩
The text was updated successfully, but these errors were encountered: