canic_core/ids/
endpoint.rs1#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
6pub struct EndpointCall {
7 pub endpoint: EndpointId,
8 pub kind: EndpointCallKind,
9}
10
11#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16pub enum EndpointCallKind {
17 Query,
18 QueryComposite,
19 Update,
20}
21
22impl EndpointCallKind {
23 #[must_use]
24 pub const fn metric_label(self) -> &'static str {
25 match self {
26 Self::Query => "query",
27 Self::QueryComposite => "composite_query",
28 Self::Update => "update",
29 }
30 }
31}
32
33#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
38pub struct EndpointId {
39 pub name: &'static str,
40}
41
42impl EndpointId {
43 #[must_use]
44 pub const fn new(name: &'static str) -> Self {
45 Self { name }
46 }
47}