Skip to main content

cloudcover_core/
api_method.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
4pub struct ApiMethod {
5    service: String,
6    name: String,
7}
8
9impl ApiMethod {
10    #[must_use]
11    pub fn new(service: impl Into<String>, name: impl Into<String>) -> Self {
12        Self {
13            service: service.into(),
14            name: name.into(),
15        }
16    }
17
18    #[must_use]
19    pub fn service(&self) -> &str {
20        &self.service
21    }
22
23    #[must_use]
24    pub fn name(&self) -> &str {
25        &self.name
26    }
27}