forked from tikv/client-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisk_usage.rs
More file actions
30 lines (30 loc) · 1.06 KB
/
disk_usage.rs
File metadata and controls
30 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// This file is @generated by prost-build.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DiskUsage {
Normal = 0,
AlmostFull = 1,
AlreadyFull = 2,
}
impl DiskUsage {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
DiskUsage::Normal => "Normal",
DiskUsage::AlmostFull => "AlmostFull",
DiskUsage::AlreadyFull => "AlreadyFull",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Normal" => Some(Self::Normal),
"AlmostFull" => Some(Self::AlmostFull),
"AlreadyFull" => Some(Self::AlreadyFull),
_ => None,
}
}
}