[−][src]Struct uni_tmp_jni::objects::AutoPrimitiveArray
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]
env: &'b JNIEnv<'a>,
obj: JObject<'a>,
ptr: *mut c_void,
mode: ReleaseMode,
is_copy: bool
) -> Result<Self>
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]
fn from(other: &'a AutoPrimitiveArray<'_, '_>) -> *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,
'a: 'b,
impl<'a, 'b> UnwindSafe for AutoPrimitiveArray<'a, 'b>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,