fundamentum_sdk_api/client/
api_version.rs1#[derive(Debug, Clone, Copy)]
7#[deprecated(
8 since = "0.2.0",
9 note = "Use V2 or V3 instead of V1. V1 is deprecated."
10)]
11pub struct V1;
12
13#[derive(Debug, Clone, Copy)]
16pub struct V2;
17
18#[derive(Debug, Clone, Copy)]
21pub struct V3;
22
23pub trait ApiVersion {
25 fn version_str() -> &'static str;
27}
28
29impl ApiVersion for V2 {
30 fn version_str() -> &'static str {
31 "v2"
32 }
33}
34
35impl ApiVersion for V3 {
36 fn version_str() -> &'static str {
37 "v3"
38 }
39}
40
41#[cfg(test)]
42mod tests {
43 use super::*;
44
45 #[test]
46 fn test_v2_version() {
47 assert_eq!(V2::version_str(), "v2");
48 }
49
50 #[test]
51 fn test_v3_version() {
52 assert_eq!(V3::version_str(), "v3");
53 }
54}