init bucketmeta

This commit is contained in:
weisd
2024-09-27 16:33:56 +08:00
parent cef6a583b7
commit b4f8088f0f
22 changed files with 687 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
use std::str::FromStr;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum Effect {
#[default]
Allow,
Deny,
}
// 实现从字符串解析Effect的功能
impl FromStr for Effect {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Allow" => Ok(Effect::Allow),
"Deny" => Ok(Effect::Deny),
_ => Err(()),
}
}
}