MCPcopy Create free account
hub / github.com/buttplugio/buttplug / handle_ping

Method handle_ping

crates/buttplug_server/src/server.rs:479–489  ·  view source on GitHub ↗

Update the [PingTimer] with the latest received ping message.

(&self, msg: message::PingV0)

Source from the content-addressed store, hash-verified

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)]

Callers 1

parse_checked_messageMethod · 0.80

Calls 3

OkClass · 0.85
update_ping_timeMethod · 0.80
idMethod · 0.45

Tested by

no test coverage detected