pub struct JList<'a: 'b, 'b> { /* private fields */ }
Expand description
Wrapper for JObjects that implement java/util/List
. Provides methods to get,
add, and remove elements.
Looks up the class and method ids on creation rather than for every method call.
Implementations
sourceimpl<'a: 'b, 'b> JList<'a, 'b>
impl<'a: 'b, 'b> JList<'a, 'b>
sourcepub fn from_env(env: &'b JNIEnv<'a>, obj: JObject<'a>) -> Result<JList<'a, 'b>>
pub fn from_env(env: &'b JNIEnv<'a>, obj: JObject<'a>) -> Result<JList<'a, 'b>>
Create a map from the environment and an object. This looks up the necessary class and method ids to call all of the methods on it so that exra work doesn’t need to be done on every method call.
sourcepub fn get(&self, idx: jint) -> Result<Option<JObject<'a>>>
pub fn get(&self, idx: jint) -> Result<Option<JObject<'a>>>
Look up the value for a key. Returns Some
if it’s found and None
if
a null pointer would be returned.
sourcepub fn insert(&self, idx: jint, value: JObject<'a>) -> Result<()>
pub fn insert(&self, idx: jint, value: JObject<'a>) -> Result<()>
Insert an element at a specific index
sourcepub fn remove(&self, idx: jint) -> Result<Option<JObject<'a>>>
pub fn remove(&self, idx: jint) -> Result<Option<JObject<'a>>>
Remove an element from the list by index
Trait Implementations
Auto Trait Implementations
impl<'a, 'b> RefUnwindSafe for JList<'a, 'b>
impl<'a, 'b> !Send for JList<'a, 'b>
impl<'a, 'b> !Sync for JList<'a, 'b>
impl<'a, 'b> Unpin for JList<'a, 'b> where
'a: 'b,
impl<'a, 'b> UnwindSafe for JList<'a, 'b>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more