pub struct AutoPrimitiveArray<'a: 'b, 'b> { /* private fields */ }Expand description
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§
Source§impl<'a, 'b> AutoPrimitiveArray<'a, 'b>
impl<'a, 'b> AutoPrimitiveArray<'a, 'b>
Sourcepub fn new(
env: &'b JNIEnv<'a>,
obj: JObject<'a>,
ptr: *mut c_void,
mode: ReleaseMode,
is_copy: bool,
) -> Result<Self>
pub fn new( 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.
Trait Implementations§
Source§impl<'a, 'b> Drop for AutoPrimitiveArray<'a, 'b>
impl<'a, 'b> Drop for AutoPrimitiveArray<'a, 'b>
Auto Trait Implementations§
impl<'a, 'b> Freeze for AutoPrimitiveArray<'a, 'b>
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>
impl<'a, 'b> UnwindSafe for AutoPrimitiveArray<'a, 'b>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more