Add an item to the set
(&mut self, env: &mut JNIEnv<'a>, v: T)
| 48 | |
| 49 | /// Add an item to the set |
| 50 | pub fn add(&mut self, env: &mut JNIEnv<'a>, v: T) -> Result<()> { |
| 51 | let value = JValueGen::Object(v.as_ref()); |
| 52 | env.call_method(&self.obj, "add", "(Ljava/lang/Object;)Z", &[value])?; |
| 53 | self.size += 1; |
| 54 | Ok(()) |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | impl<'a, T> AsRef<JObject<'a>> for Set<'a, T> { |
no test coverage detected