pub struct JExceptionInInitializerError<'local>(/* private fields */);Expand description
A java.lang.ExceptionInInitializerError reference, tied to a JNI local reference frame.
See the JObject documentation for more information about object references,
how to cast them, and local reference frame lifetimes.
Implementations§
Source§impl<'local> JExceptionInInitializerError<'local>
impl<'local> JExceptionInInitializerError<'local>
Sourcepub unsafe fn from_raw<'env_inner>(
env: &Env<'env_inner>,
raw: jobject,
) -> JExceptionInInitializerError<'env_inner>
pub unsafe fn from_raw<'env_inner>( env: &Env<'env_inner>, raw: jobject, ) -> JExceptionInInitializerError<'env_inner>
Creates a JExceptionInInitializerError that wraps the given raw jobject
§Safety
rawmust be a valid raw JNI local reference (ornull).rawmust be an instance of the correct Java class.- There must not be any other owning Reference wrapper for the same reference.
- The local reference must belong to the current thread and not outlive the
JNI stack frame associated with the Env
'locallifetime.
Sourcepub const fn null() -> JExceptionInInitializerError<'static>
pub const fn null() -> JExceptionInInitializerError<'static>
Creates a new null reference.
Null references are always valid and do not belong to a local reference frame. Therefore,
the returned JExceptionInInitializerError always has the 'static lifetime.
Sourcepub fn cast_local<'any_local>(
env: &mut Env<'_>,
obj: impl Reference + Into<JObject<'any_local>> + AsRef<JObject<'any_local>>,
) -> Result<JExceptionInInitializerError<'any_local>>
pub fn cast_local<'any_local>( env: &mut Env<'_>, obj: impl Reference + Into<JObject<'any_local>> + AsRef<JObject<'any_local>>, ) -> Result<JExceptionInInitializerError<'any_local>>
Cast a local reference to a JExceptionInInitializerError
This will do a runtime (IsInstanceOf) check that the object is an instance of the correct class.
Also see these other options for casting local or global references to a JExceptionInInitializerError:
§Errors
Returns Error::WrongObjectType if the IsInstanceOf check fails.
Source§impl<'local> JExceptionInInitializerError<'local>
impl<'local> JExceptionInInitializerError<'local>
Sourcepub fn as_throwable(&self) -> Cast<'local, '_, JThrowable<'local>>
pub fn as_throwable(&self) -> Cast<'local, '_, JThrowable<'local>>
Casts this JExceptionInInitializerError to a ::jni::objects::JThrowable
This does not require a runtime type check since any JExceptionInInitializerError is also a ::jni::objects::JThrowable
Source§impl JExceptionInInitializerError<'static>
impl JExceptionInInitializerError<'static>
Sourcepub fn new_null<'env_local>(
env: &mut Env<'env_local>,
) -> Result<JExceptionInInitializerError<'env_local>>
pub fn new_null<'env_local>( env: &mut Env<'env_local>, ) -> Result<JExceptionInInitializerError<'env_local>>
Construct without any message
Sourcepub fn new<'env_local, 'local_0>(
env: &mut Env<'env_local>,
msg: impl AsRef<JString<'local_0>>,
) -> Result<JExceptionInInitializerError<'env_local>>
pub fn new<'env_local, 'local_0>( env: &mut Env<'env_local>, msg: impl AsRef<JString<'local_0>>, ) -> Result<JExceptionInInitializerError<'env_local>>
Construct with a message
Sourcepub fn new_with_exception<'env_local, 'local_0>(
env: &mut Env<'env_local>,
cause: impl AsRef<JThrowable<'local_0>>,
) -> Result<JExceptionInInitializerError<'env_local>>
pub fn new_with_exception<'env_local, 'local_0>( env: &mut Env<'env_local>, cause: impl AsRef<JThrowable<'local_0>>, ) -> Result<JExceptionInInitializerError<'env_local>>
Construct with only an exception cause and a null message
Source§impl<'local> JExceptionInInitializerError<'local>
impl<'local> JExceptionInInitializerError<'local>
Sourcepub fn get_cause<'env_local>(
&self,
env: &mut Env<'env_local>,
) -> Result<JThrowable<'env_local>>
pub fn get_cause<'env_local>( &self, env: &mut Env<'env_local>, ) -> Result<JThrowable<'env_local>>
Returns the exception that was thrown during static initialization.
Sourcepub fn get_exception<'env_local>(
&self,
env: &mut Env<'env_local>,
) -> Result<JThrowable<'env_local>>
pub fn get_exception<'env_local>( &self, env: &mut Env<'env_local>, ) -> Result<JThrowable<'env_local>>
Returns the exception that was thrown during static initialization.
Source§impl<'local> JExceptionInInitializerError<'local>
impl<'local> JExceptionInInitializerError<'local>
Sourcepub fn matches<'any, 'from>(
env: &Env<'_>,
throwable: &'from JThrowable<'any>,
) -> Result<Option<Cast<'any, 'from, JExceptionInInitializerError<'any>>>>
pub fn matches<'any, 'from>( env: &Env<'_>, throwable: &'from JThrowable<'any>, ) -> Result<Option<Cast<'any, 'from, JExceptionInInitializerError<'any>>>>
Checks if the given throwable is an instance of this exception type.
Returns Some(Cast<JExceptionInInitializerError>) if the throwable is an instance of this exception type
or returns None if it is not.
Returns Error::NullPtr if the throwable is null.
Trait Implementations§
Source§impl<'local> AsRef<JExceptionInInitializerError<'local>> for JExceptionInInitializerError<'local>
impl<'local> AsRef<JExceptionInInitializerError<'local>> for JExceptionInInitializerError<'local>
Source§fn as_ref(&self) -> &JExceptionInInitializerError<'local>
fn as_ref(&self) -> &JExceptionInInitializerError<'local>
Source§impl<'local> AsRef<JObject<'local>> for JExceptionInInitializerError<'local>
impl<'local> AsRef<JObject<'local>> for JExceptionInInitializerError<'local>
Source§impl<'local> AsRef<JThrowable<'local>> for JExceptionInInitializerError<'local>
impl<'local> AsRef<JThrowable<'local>> for JExceptionInInitializerError<'local>
Source§fn as_ref(&self) -> &JThrowable<'local>
fn as_ref(&self) -> &JThrowable<'local>
Source§impl<'local> Debug for JExceptionInInitializerError<'local>
impl<'local> Debug for JExceptionInInitializerError<'local>
Source§impl<'local> Default for JExceptionInInitializerError<'local>
impl<'local> Default for JExceptionInInitializerError<'local>
Source§fn default() -> JExceptionInInitializerError<'local>
fn default() -> JExceptionInInitializerError<'local>
Source§impl<'local> Deref for JExceptionInInitializerError<'local>
impl<'local> Deref for JExceptionInInitializerError<'local>
Source§impl<'local> From<JExceptionInInitializerError<'local>> for JObject<'local>
impl<'local> From<JExceptionInInitializerError<'local>> for JObject<'local>
Source§fn from(other: JExceptionInInitializerError<'local>) -> JObject<'local>
fn from(other: JExceptionInInitializerError<'local>) -> JObject<'local>
Source§impl<'local> From<JExceptionInInitializerError<'local>> for JThrowable<'local>
impl<'local> From<JExceptionInInitializerError<'local>> for JThrowable<'local>
Source§fn from(value: JExceptionInInitializerError<'local>) -> JThrowable<'local>
fn from(value: JExceptionInInitializerError<'local>) -> JThrowable<'local>
Source§impl<'local> Reference for JExceptionInInitializerError<'local>
impl<'local> Reference for JExceptionInInitializerError<'local>
Source§type Kind<'env> = JExceptionInInitializerError<'env>
type Kind<'env> = JExceptionInInitializerError<'env>
Self::Kind type corresponds to the underlying
class type (such as JObject or JString), parameterized by the
lifetime that indicates whether the type holds a global reference
('static) or a local reference that’s tied to a JNI stack frame. Read moreSource§type GlobalKind = JExceptionInInitializerError<'static>
type GlobalKind = JExceptionInInitializerError<'static>
GlobalKind type should be equivalent to
Kind<'static>, with the additional bound that ensures the type is
Send + Sync Read moreSource§fn as_raw(&self) -> jobject
fn as_raw(&self) -> jobject
crate::sys::jobject reference.Source§fn class_name() -> Cow<'static, JNIStr>
fn class_name() -> Cow<'static, JNIStr>
Source§fn lookup_class<'caller>(
env: &Env<'_>,
loader_context: &LoaderContext<'_, '_>,
) -> Result<impl Deref<Target = Global<JClass<'static>>> + 'caller>
fn lookup_class<'caller>( env: &Env<'_>, loader_context: &LoaderContext<'_, '_>, ) -> Result<impl Deref<Target = Global<JClass<'static>>> + 'caller>
Source§unsafe fn kind_from_raw<'env>(local_ref: jobject) -> Self::Kind<'env>
unsafe fn kind_from_raw<'env>(local_ref: jobject) -> Self::Kind<'env>
Self::Kind for the given reference that is tied
to the specified lifetime. Read moreSource§unsafe fn global_kind_from_raw(global_ref: jobject) -> Self::GlobalKind
unsafe fn global_kind_from_raw(global_ref: jobject) -> Self::GlobalKind
Source§fn null<'any>() -> Self::Kind<'any>
fn null<'any>() -> Self::Kind<'any>
null reference based on Self::Kind