Struct jni::objects::JClass

source ·
#[repr(transparent)]
pub struct JClass<'local>(_);
Expand description

Lifetime’d representation of a jclass. Just a JObject wrapped in a new class.

Implementations§

source§

impl<'local> JClass<'local>

source

pub unsafe fn from_raw(raw: jclass) -> Self

Creates a JClass that wraps the given raw jclass

Safety

raw may be a null pointer. If raw is not a null pointer, then:

  • raw must be a valid raw JNI local reference.
  • There must not be any other JObject representing the same local reference.
  • The lifetime 'local must not outlive the local reference frame that the local reference was created in.
source

pub fn as_raw(&self) -> jclass

Returns the raw JNI pointer.

source

pub fn into_raw(self) -> jclass

Unwrap to the raw jni type.

Methods from Deref<Target = JObject<'local>>§

source

pub fn as_raw(&self) -> jobject

Returns the raw JNI pointer.

Trait Implementations§

source§

impl<'local> AsRef<JClass<'local>> for JClass<'local>

source§

fn as_ref(&self) -> &JClass<'local>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'local> AsRef<JObject<'local>> for JClass<'local>

source§

fn as_ref(&self) -> &JObject<'local>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'local> Debug for JClass<'local>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'local> Default for JClass<'local>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'local> Deref for JClass<'local>

§

type Target = JObject<'local>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'local, T> Desc<'local, JClass<'local>> for Twhere T: Into<JNIString>,

§

type Output = AutoLocal<'local, JClass<'local>>

The type that this Desc returns.
source§

fn lookup(self, env: &mut JNIEnv<'local>) -> Result<Self::Output>

Look up the concrete type from the JVM. Read more
source§

impl<'local, 'obj_ref> Desc<'local, JClass<'static>> for &'obj_ref GlobalRef

This conversion assumes that the GlobalRef is a pointer to a class object.

§

type Output = &'obj_ref JClass<'static>

The type that this Desc returns.
source§

fn lookup(self, _: &mut JNIEnv<'local>) -> Result<Self::Output>

Look up the concrete type from the JVM. Read more
source§

impl<'local, 'obj_ref> From<&'obj_ref JObject<'local>> for &'obj_ref JClass<'local>

This conversion assumes that the JObject is a pointer to a class object.

source§

fn from(other: &'obj_ref JObject<'local>) -> Self

Converts to this type from the input type.
source§

impl<'local> From<JClass<'local>> for JObject<'local>

source§

fn from(other: JClass<'_>) -> JObject<'_>

Converts to this type from the input type.
source§

impl<'local> From<JObject<'local>> for JClass<'local>

This conversion assumes that the JObject is a pointer to a class object.

source§

fn from(other: JObject<'_>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'local> RefUnwindSafe for JClass<'local>

§

impl<'local> Send for JClass<'local>where 'local: 'static,

§

impl<'local> Sync for JClass<'local>where 'local: 'static,

§

impl<'local> Unpin for JClass<'local>

§

impl<'local> UnwindSafe for JClass<'local>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.