xrpl_api/api/ping.rs
1//! The ping command returns an acknowledgement, so that clients can test the
2//! connection status and latency.
3//!
4//! <https://xrpl.org/ping.html>
5
6use crate::Request;
7use serde::{Deserialize, Serialize};
8
9#[derive(Default, Debug, Clone, Serialize)]
10pub struct PingRequest {}
11
12impl Request for PingRequest {
13 type Response = PingResponse;
14
15 fn method(&self) -> String {
16 "ping".to_owned()
17 }
18}
19
20impl PingRequest {
21 pub fn new() -> Self {
22 Self::default()
23 }
24}
25
26#[derive(Debug, Deserialize)]
27pub struct PingResponse {}