pub struct PingRequest {
pub metadata: HashMap<String, Value>,
}Expand description
Ping request for connection health checking.
Either client or server can send ping requests to verify that the connection is still active and responsive.
Fields§
§metadata: HashMap<String, Value>Optional metadata for the ping
Implementations§
Source§impl PingRequest
impl PingRequest
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ping request.
§Examples
use mcp_probe_core::messages::PingRequest;
let ping = PingRequest::new();Sourcepub fn with_timestamp(timestamp: impl Into<String>) -> Self
pub fn with_timestamp(timestamp: impl Into<String>) -> Self
Create a ping request with a timestamp.
The timestamp can be used to measure round-trip time.
§Examples
use mcp_probe_core::messages::PingRequest;
use serde_json::json;
let ping = PingRequest::with_timestamp("2024-01-15T10:30:00Z");Trait Implementations§
Source§impl Clone for PingRequest
impl Clone for PingRequest
Source§fn clone(&self) -> PingRequest
fn clone(&self) -> PingRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PingRequest
impl Debug for PingRequest
Source§impl Default for PingRequest
impl Default for PingRequest
Source§impl<'de> Deserialize<'de> for PingRequest
impl<'de> Deserialize<'de> for PingRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PingRequest
impl PartialEq for PingRequest
Source§impl Serialize for PingRequest
impl Serialize for PingRequest
impl Eq for PingRequest
impl StructuralPartialEq for PingRequest
Auto Trait Implementations§
impl Freeze for PingRequest
impl RefUnwindSafe for PingRequest
impl Send for PingRequest
impl Sync for PingRequest
impl Unpin for PingRequest
impl UnwindSafe for PingRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.