pub struct ByteArray(/* private fields */);
Expand description

A PrimitiveArray implementation.

Trait Implementations§

source§

impl JniType for ByteArray

source§

fn static_with_jni_type<R>(callback: impl FnOnce(&str) -> R) -> R

source§

impl PrimitiveArray<i8> for ByteArray

source§

fn new<'env>(env: Env<'env>, size: usize) -> Local<'env, Self>

Uses env.New{Type}Array to create a new java array containing “size” elements.
source§

fn new_from<'env>(env: Env<'env>, elements: &[jbyte]) -> Local<'env, Self>

Uses env.New{Type}Array + Set{Type}ArrayRegion to create a new java array containing a copy of “elements”.
source§

fn len(&self) -> usize

Uses env.GetArrayLength to get the length of the java array.
source§

fn get_region(&self, start: usize, elements: &mut [jbyte])

Uses env.Get{Type}ArrayRegion to read the contents of the java array from [start .. start + elements.len())
source§

fn set_region(&self, start: usize, elements: &[jbyte])

Uses env.Set{Type}ArrayRegion to set the contents of the java array from [start .. start + elements.len())
source§

fn get_region_as_vec(&self, range: impl RangeBounds<usize>) -> Vec<T>

Uses env.GetArrayLength + env.Get{Type}ArrayRegion to read the contents of the java array from range into a new Vec.
source§

fn as_vec(&self) -> Vec<T>

Uses env.GetArrayLength + env.Get{Type}ArrayRegion to read the contents of the entire java array into a new Vec.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

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 T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> AssignableTo<T> for T
where T: ReferenceType,