Skip to main content

ResultExt

Trait ResultExt 

Source
pub trait ResultExt<T> {
    // Required methods
    fn unwrap_java(self, e: &mut Env<'_>) -> T;
    fn to_throwable(self, e: &mut Env<'_>) -> Result<T, Throwable>;
}
Expand description

[toad_jni::errors::Result] interop helpers

Required Methods§

Source

fn unwrap_java(self, e: &mut Env<'_>) -> T

If a java exception occurred, toString it and panic

Source

fn to_throwable(self, e: &mut Env<'_>) -> Result<T, Throwable>

If a java exception occurred, convert to java::lang::Throwable

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> ResultExt<T> for Result<T>

Source§

fn unwrap_java(self, e: &mut Env<'_>) -> T

Source§

fn to_throwable(self, e: &mut Env<'_>) -> Result<T, Throwable>

Implementors§