Update the [PingTimer] with the latest received ping message.
(&self, msg: message::PingV0)
| 477 | |
| 478 | /// Update the [PingTimer] with the latest received ping message. |
| 479 | fn handle_ping(&self, msg: message::PingV0) -> ButtplugServerResultFuture { |
| 480 | if self.max_ping_time == 0 { |
| 481 | return ButtplugPingError::PingTimerNotRunning.into(); |
| 482 | } |
| 483 | let fut = self.ping_timer.update_ping_time(); |
| 484 | async move { |
| 485 | fut.await; |
| 486 | Result::Ok(message::OkV0::new(msg.id()).into()) |
| 487 | } |
| 488 | .boxed() |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | #[cfg(test)] |
no test coverage detected