#[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 JByteBuffer<'a>
impl<'a> From<JObject<'a>> for JByteBuffer<'a>
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 JThrowable<'a>
impl<'a> From<JObject<'a>> for JThrowable<'a>
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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