#[repr(transparent)]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
Trait Implementations
sourceimpl<'a> From<JByteBuffer<'a>> for JObject<'a>
impl<'a> From<JByteBuffer<'a>> for JObject<'a>
sourcefn from(other: JByteBuffer<'_>) -> JObject<'_>
fn from(other: JByteBuffer<'_>) -> JObject<'_>
Converts to this type from the input type.
sourceimpl<'a> From<JObject<'a>> for JThrowable<'a>
impl<'a> From<JObject<'a>> for JThrowable<'a>
sourcefn from(other: JObject<'_>) -> JThrowable<'_>
fn from(other: JObject<'_>) -> JThrowable<'_>
Converts to this type from the input type.
sourceimpl<'a> From<JObject<'a>> for JClass<'a>
impl<'a> From<JObject<'a>> for JClass<'a>
This conversion assumes that the JObject
is a pointer to a class object.
sourceimpl<'a> From<JObject<'a>> for JByteBuffer<'a>
impl<'a> From<JObject<'a>> for JByteBuffer<'a>
sourcefn from(other: JObject<'_>) -> JByteBuffer<'_>
fn from(other: JObject<'_>) -> JByteBuffer<'_>
Converts to this type from the input type.
sourceimpl<'a> From<JThrowable<'a>> for JObject<'a>
impl<'a> From<JThrowable<'a>> for JObject<'a>
sourcefn from(other: JThrowable<'_>) -> JObject<'_>
fn from(other: JThrowable<'_>) -> JObject<'_>
Converts to this type from the input type.
impl<'a> Copy for JObject<'a>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more