We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement an exception type that can be used for throwing exceptions in the rust runtime.
trait JavaException { type Exception<'l, 'c>: Desc<'l, JClass<'c>>; fn lookup(env:&JniEnv) -> Result<Self::Exception, JniError>; }
Which would allow Scope::throw_new to accept JavaException as a type parameter:
Scope::throw_new
JavaException
pub fn throw_new<E>(&self, msg: S) where E: JavaException { let Scope { vm, env, .. } = self; system_call(vm, || { let desc = E::lookup(env)?; env.throw_new(desc, msg) }) }
Usage as:
struct RuntimeException; impl JavaException for RuntimeException { ... } scope.throw_new::<RuntimeException>("...");
The text was updated successfully, but these errors were encountered:
SirCipher
No branches or pull requests
Implement an exception type that can be used for throwing exceptions in the rust runtime.
Which would allow
Scope::throw_new
to acceptJavaException
as a type parameter:Usage as:
The text was updated successfully, but these errors were encountered: