JObject

Struct JObject 

Source
pub struct JObject<'a> { /* private fields */ }
Expand description

Wrapper around sys::jobject that adds a lifetime. This prevents it from outliving the context in which it was acquired and getting GC’d out from under us. It matches C’s representation of the raw pointer, so it can be used in any of the extern function argument positions that would take a jobject.

Most other types in the objects module deref to this, as they do in the C representation.

Implementations§

Source§

impl<'a> JObject<'a>

Source

pub fn into_inner(self) -> *mut _jobject

Unwrap to the internal jni type.

Source

pub fn null() -> JObject<'a>

Creates a new null object

Trait Implementations§

Source§

impl<'a> Clone for JObject<'a>

Source§

fn clone(&self) -> JObject<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for JObject<'a>

Source§

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

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

impl<'a> Deref for JObject<'a>

Source§

type Target = *mut _jobject

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<JObject<'a> as Deref>::Target

Dereferences the value.
Source§

impl<'a, 'b> Desc<'a, JClass<'a>> for JObject<'b>

Source§

fn lookup(self, env: &JNIEnv<'a>) -> Result<JClass<'a>, Error>

Look up the concrete type from the JVM.
Source§

impl<'a> From<&'a AutoLocal<'a, '_>> for JObject<'a>

Source§

fn from(other: &'a AutoLocal<'_, '_>) -> JObject<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a GlobalRef> for JObject<'a>

Source§

fn from(other: &'a GlobalRef) -> JObject<'a>

Converts to this type from the input type.
Source§

impl<'a> From<*mut _jobject> for JObject<'a>

Source§

fn from(other: *mut _jobject) -> JObject<'a>

Converts to this type from the input type.
Source§

impl<'a> From<JByteBuffer<'a>> for JObject<'a>

Source§

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

Converts to this type from the input type.
Source§

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

Source§

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

Converts to this type from the input type.
Source§

impl<'a, 'b> From<JList<'a, 'b>> for JObject<'a>
where 'a: 'b,

Source§

fn from(other: JList<'a, 'b>) -> JObject<'a>

Converts to this type from the input type.
Source§

impl<'a, 'b> From<JMap<'a, 'b>> for JObject<'a>
where 'a: 'b,

Source§

fn from(other: JMap<'a, 'b>) -> JObject<'a>

Converts to this type from the input type.
Source§

impl<'a> From<JString<'a>> for JObject<'a>

Source§

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

Converts to this type from the input type.
Source§

impl<'a> From<JThrowable<'a>> for JObject<'a>

Source§

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

Converts to this type from the input type.
Source§

impl<'a> Copy for JObject<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for JObject<'a>

§

impl<'a> RefUnwindSafe for JObject<'a>

§

impl<'a> !Send for JObject<'a>

§

impl<'a> !Sync for JObject<'a>

§

impl<'a> Unpin for JObject<'a>

§

impl<'a> UnwindSafe for JObject<'a>

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Component + Float, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
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> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

fn type_name(&self) -> &'static str

Gets the type name of self
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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, U> ConvertInto<U> for T
where U: ConvertFrom<T>,

Source§

fn convert_into(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

fn convert_unclamped_into(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Source§

fn try_convert_into(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

impl<'a, T> Desc<'a, T> for T

Source§

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

Look up the concrete type from the JVM.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.