ic_query/ic/model/requests/
dashboard.rs1#[derive(Clone, Debug, Eq, PartialEq)]
10pub struct IcDashboardRequest {
11 pub source_endpoint: String,
13 pub now_unix_secs: u64,
15}
16
17impl IcDashboardRequest {
18 #[must_use]
20 pub fn new(source_endpoint: impl Into<String>, now_unix_secs: u64) -> Self {
21 Self {
22 source_endpoint: source_endpoint.into(),
23 now_unix_secs,
24 }
25 }
26
27 #[cfg(feature = "dashboard-host")]
29 #[must_use]
30 pub fn source_request(&self) -> crate::ic::IcSourceRequest {
31 crate::ic::IcSourceRequest::new(
32 &self.source_endpoint,
33 crate::subnet_catalog::format_utc_timestamp_secs(self.now_unix_secs),
34 "ic-query",
35 )
36 }
37}