[][src]Struct uni_tmp_jni::objects::AutoPrimitiveArray

pub struct AutoPrimitiveArray<'a: 'b, 'b> { /* fields omitted */ }

Auto-release wrapper for pointer-based primitive arrays.

This wrapper is used to wrap pointers returned by get_primitive_array_critical.

These pointers normally need to be released manually, through a call to release_primitive_array_critical. This wrapper provides automatic pointer-based array release when it goes out of scope.

Implementations

impl<'a, 'b> AutoPrimitiveArray<'a, 'b>[src]

pub fn new(
    env: &'b JNIEnv<'a>,
    obj: JObject<'a>,
    ptr: *mut c_void,
    mode: ReleaseMode,
    is_copy: bool
) -> Result<Self>
[src]

Creates a new auto-release wrapper for a pointer-based primitive array.

Once this wrapper goes out of scope, release_primitive_array_critical will be called on the object. While wrapped, the object can be accessed via the From impl.

pub fn as_ptr(&self) -> *mut c_void[src]

Get a reference to the wrapped pointer

pub fn commit(&mut self)[src]

Commits the result of the array, if it is a copy

pub fn is_copy(&self) -> bool[src]

Indicates if the array is a copy or not

Trait Implementations

impl<'a, 'b> Drop for AutoPrimitiveArray<'a, 'b>[src]

impl<'a, '_> From<&'a AutoPrimitiveArray<'a, '_>> for *mut c_void[src]

Auto Trait Implementations

impl<'a, 'b> RefUnwindSafe for AutoPrimitiveArray<'a, 'b>

impl<'a, 'b> !Send for AutoPrimitiveArray<'a, 'b>

impl<'a, 'b> !Sync for AutoPrimitiveArray<'a, 'b>

impl<'a, 'b> Unpin for AutoPrimitiveArray<'a, 'b> where
    'a: 'b, 

impl<'a, 'b> UnwindSafe for AutoPrimitiveArray<'a, 'b>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.