mongodb/client/session/
cluster_time.rs1use derive_where::derive_where;
2use serde::{Deserialize, Serialize};
3
4use crate::bson::{Document, Timestamp};
5
6#[derive(Debug, Deserialize, Clone, Serialize)]
11#[derive_where(PartialEq, Eq)]
12#[serde(rename_all = "camelCase")]
13pub struct ClusterTime {
14 pub(crate) cluster_time: Timestamp,
15
16 #[derive_where(skip)]
17 pub(crate) signature: Document,
18}
19
20impl std::cmp::Ord for ClusterTime {
21 fn cmp(&self, other: &ClusterTime) -> std::cmp::Ordering {
22 self.cluster_time.cmp(&other.cluster_time)
23 }
24}
25
26impl std::cmp::PartialOrd for ClusterTime {
27 fn partial_cmp(&self, other: &ClusterTime) -> Option<std::cmp::Ordering> {
28 Some(self.cmp(other))
29 }
30}