Skip to main content

ResultYieldToJavaOrThrow

Trait ResultYieldToJavaOrThrow 

Source
pub trait ResultYieldToJavaOrThrow {
    // Required method
    fn yield_to_java_or_throw(self, e: &mut Env<'_>) -> jobject;
}
Expand description

Handle a Result<impl java::Object, Throwable> in a native method implementation.

if Err throw the Throwable contained in the result.

if Ok invoke java::Object::yield_to_java.

Required Methods§

Source

fn yield_to_java_or_throw(self, e: &mut Env<'_>) -> jobject

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> ResultYieldToJavaOrThrow for Result<T, Throwable>
where T: Object,

Source§

fn yield_to_java_or_throw(self, e: &mut Env<'_>) -> jobject

Implementors§