Struct jni::objects::AutoArray[][src]

pub struct AutoArray<'a: 'b, 'b, T: TypeArray> { /* fields omitted */ }

Auto-release wrapper for pointer-based generic arrays.

This wrapper is used to wrap pointers returned by GetArrayElements. While wrapped, the object can be accessed via the From impl.

AutoArray provides automatic array release through a call to appropriate ReleaseArrayElements when it goes out of scope.

Implementations

impl<'a, 'b, T: TypeArray> AutoArray<'a, 'b, T>[src]

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

Get a reference to the wrapped pointer

pub fn commit(&self) -> Result<()>[src]

Commits the changes to the array, if it is a copy

pub fn discard(&mut self)[src]

Don't commit the changes to the array on release (if it is a copy). This has no effect if the array is not a copy. This method is useful to change the release mode of an array originally created with ReleaseMode::CopyBack.

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

Indicates if the array is a copy or not

pub fn size(&self) -> Result<jsize>[src]

Returns the array size

Trait Implementations

impl<'a, 'b, T: TypeArray> Drop for AutoArray<'a, 'b, T>[src]

Auto Trait Implementations

impl<'a, 'b, T> RefUnwindSafe for AutoArray<'a, 'b, T> where
    T: RefUnwindSafe
[src]

impl<'a, 'b, T> !Send for AutoArray<'a, 'b, T>[src]

impl<'a, 'b, T> !Sync for AutoArray<'a, 'b, T>[src]

impl<'a, 'b, T> Unpin for AutoArray<'a, 'b, T> where
    'a: 'b, 
[src]

impl<'a, 'b, T> UnwindSafe for AutoArray<'a, 'b, T> where
    T: RefUnwindSafe
[src]

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.