MCPcopy Create free account
hub / github.com/deviceplug/btleplug / with_obj

Method with_obj

src/droidplug/peripheral.rs:195–205  ·  view source on GitHub ↗
(
        &self,
        f: impl FnOnce(&JNIEnv, JPeripheral) -> std::result::Result<T, E>,
    )

Source from the content-addressed store, hash-verified

193 }
194
195 fn with_obj<T, E>(
196 &self,
197 f: impl FnOnce(&JNIEnv, JPeripheral) -> std::result::Result<T, E>,
198 ) -> std::result::Result<T, E>
199 where
200 E: From<::jni::errors::Error>,
201 {
202 let env = global_jvm().get_env()?;
203 let obj = JPeripheral::from_env(&env, self.internal.as_obj())?;
204 f(&env, obj)
205 }
206
207 async fn set_characteristic_notification(
208 &self,

Callers 13

is_connectedMethod · 0.80
connectMethod · 0.80
disconnectMethod · 0.80
discover_servicesMethod · 0.80
writeMethod · 0.80
readMethod · 0.80
notificationsMethod · 0.80
read_rssiMethod · 0.80
write_descriptorMethod · 0.80
read_descriptorMethod · 0.80
connection_parametersMethod · 0.80

Calls 1

global_jvmFunction · 0.85

Tested by

no test coverage detected