droid_wrap_utils

Struct JClass

Source
pub struct JClass<'local>(/* private fields */);
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: *mut _jobject) -> JClass<'local>

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) -> *mut _jobject

Returns the raw JNI pointer.

Source

pub fn into_raw(self) -> *mut _jobject

Unwrap to the raw jni type.

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

Source

pub fn as_raw(&self) -> *mut _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<(), Error>

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

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

Source§

fn default() -> JClass<'local>

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

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

Source§

type Target = JObject<'local>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<JClass<'local> as Deref>::Target

Dereferences the value.
Source§

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

Source§

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

The type that this Desc returns.
Source§

fn lookup( self, env: &mut JNIEnv<'local>, ) -> Result<<T as Desc<'local, JClass<'local>>>::Output, Error>

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.

Source§

type Output = &'obj_ref JClass<'static>

The type that this Desc returns.
Source§

fn lookup( self, _: &mut JNIEnv<'local>, ) -> Result<<&'obj_ref GlobalRef as Desc<'local, JClass<'static>>>::Output, Error>

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>) -> &'obj_ref JClass<'local>

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<'_>) -> JClass<'local>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'local> Freeze for JClass<'local>

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<'local, T> Desc<'local, T> for T
where T: AsRef<T>,

Source§

type Output = T

The type that this Desc returns.
Source§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.