canic_core/ids/
endpoint.rs1#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
14pub struct EndpointCall {
15 pub endpoint: EndpointId,
16 pub kind: EndpointCallKind,
17}
18
19#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub enum EndpointCallKind {
27 Query,
28 QueryComposite,
29 Update,
30}
31
32impl EndpointCallKind {
33 #[must_use]
34 pub const fn metric_label(self) -> &'static str {
35 match self {
36 Self::Query => "query",
37 Self::QueryComposite => "composite_query",
38 Self::Update => "update",
39 }
40 }
41}
42
43#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
50pub struct EndpointId {
51 pub name: &'static str,
52}
53
54impl EndpointId {
55 #[must_use]
56 pub const fn new(name: &'static str) -> Self {
57 Self { name }
58 }
59}