1 use crate::{ 2 descriptors::Desc, 3 errors::*, 4 objects::{JClass, JFieldID, JStaticFieldID}, 5 strings::JNIString, 6 JNIEnv, 7 }; 8 9 unsafe impl<'local, 'other_local, T, U, V> Desc<'local, JFieldID> for (T, U, V) 10 where 11 T: Desc<'local, JClass<'other_local>>, 12 U: Into<JNIString>, 13 V: Into<JNIString>, 14 { 15 type Output = JFieldID; 16 lookup(self, env: &mut JNIEnv<'local>) -> Result<Self::Output>17 fn lookup(self, env: &mut JNIEnv<'local>) -> Result<Self::Output> { 18 env.get_field_id(self.0, self.1, self.2) 19 } 20 } 21 22 unsafe impl<'local, 'other_local, T, U, V> Desc<'local, JStaticFieldID> for (T, U, V) 23 where 24 T: Desc<'local, JClass<'other_local>>, 25 U: Into<JNIString>, 26 V: Into<JNIString>, 27 { 28 type Output = JStaticFieldID; 29 lookup(self, env: &mut JNIEnv<'local>) -> Result<Self::Output>30 fn lookup(self, env: &mut JNIEnv<'local>) -> Result<Self::Output> { 31 env.get_static_field_id(self.0, self.1, self.2) 32 } 33 } 34