(&self, event: CentralEvent)
| 44 | PeripheralType: Peripheral + 'static, |
| 45 | { |
| 46 | pub fn emit(&self, event: CentralEvent) { |
| 47 | if let CentralEvent::DeviceDisconnected(ref id) = event { |
| 48 | self.peripherals.remove(id); |
| 49 | } |
| 50 | |
| 51 | if let Err(lost) = self.events_channel.send(event) { |
| 52 | trace!("Lost central event, while nothing subscribed: {:?}", lost); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | pub fn event_stream(&self) -> Pin<Box<dyn Stream<Item = CentralEvent> + Send>> { |
| 57 | let receiver = self.events_channel.subscribe(); |
no outgoing calls
no test coverage detected