nextcloud_users/capabilities/
version.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
5pub struct ServerVersion {
6 pub major: u32,
8 #[serde(default)]
10 pub minor: Option<u32>,
11 #[serde(default)]
13 pub micro: Option<u32>,
14 pub string: String,
16 #[serde(default)]
18 pub edition: Option<String>,
19 #[serde(default, alias = "extendedSupport", alias = "extended_support")]
21 pub extended_support: Option<bool>,
22}
23
24impl ServerVersion {
25 pub const fn major(&self) -> u32 {
27 self.major
28 }
29
30 pub const fn minor(&self) -> Option<u32> {
32 self.minor
33 }
34
35 pub const fn micro(&self) -> Option<u32> {
37 self.micro
38 }
39
40 pub fn string(&self) -> &str {
42 &self.string
43 }
44
45 pub fn edition(&self) -> Option<&str> {
47 self.edition.as_deref()
48 }
49
50 pub const fn extended_support(&self) -> Option<bool> {
52 self.extended_support
53 }
54}