#[repr(transparent)]
pub struct JPrimitiveArray<'local, T: TypeArray> { /* private fields */ }
Expand description

Lifetime’d representation of a jarray which wraps a JObject reference

This is a wrapper type for a JObject local reference that’s used to differentiate JVM array types.

Implementations§

source§

impl<'local, T: TypeArray> JPrimitiveArray<'local, T>

source

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

Creates a JPrimitiveArray that wraps the given raw jarray

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 into_raw(self) -> jarray

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, T: TypeArray> AsJArrayRaw<'local> for JPrimitiveArray<'local, T>

source§

fn as_jarray_raw(&self) -> jarray

Returns the raw JNI pointer as a jarray
source§

impl<'local, T: TypeArray> AsMut<JPrimitiveArray<'local, T>> for JPrimitiveArray<'local, T>

source§

fn as_mut(&mut self) -> &mut JPrimitiveArray<'local, T>

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

impl<'local, T: TypeArray> AsRef<JObject<'local>> for JPrimitiveArray<'local, T>

source§

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

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

impl<'local, T: TypeArray> AsRef<JPrimitiveArray<'local, T>> for JPrimitiveArray<'local, T>

source§

fn as_ref(&self) -> &JPrimitiveArray<'local, T>

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

impl<'local, T: Debug + TypeArray> Debug for JPrimitiveArray<'local, T>

source§

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

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

impl<'local, T: TypeArray> Default for JPrimitiveArray<'local, T>

source§

fn default() -> Self

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

impl<'local, T: TypeArray> Deref for JPrimitiveArray<'local, T>

§

type Target = JObject<'local>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'local, 'obj_ref, T: TypeArray> From<&'obj_ref JObject<'local>> for &'obj_ref JPrimitiveArray<'local, T>

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, T: TypeArray> From<JObject<'local>> for JPrimitiveArray<'local, T>

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.
source§

impl<'local, T: TypeArray> From<JPrimitiveArray<'local, T>> for JObject<'local>

source§

fn from(other: JPrimitiveArray<'local, T>) -> JObject<'_>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'local, T> RefUnwindSafe for JPrimitiveArray<'local, T>where T: RefUnwindSafe,

§

impl<'local, T> Send for JPrimitiveArray<'local, T>where T: Sync, 'local: 'static,

§

impl<'local, T> Sync for JPrimitiveArray<'local, T>where T: Sync, 'local: 'static,

§

impl<'local, T> Unpin for JPrimitiveArray<'local, T>

§

impl<'local, T> UnwindSafe for JPrimitiveArray<'local, T>where T: RefUnwindSafe,

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.