This commit is contained in:
Pascal Engélibert 2025-04-06 15:28:05 +02:00
commit 5dc6ca05ce
6 changed files with 187 additions and 24 deletions

View file

@ -7,6 +7,18 @@ pub enum Action {
Drop,
}
impl std::str::FromStr for Action {
type Err = ();
fn from_str(s: &str) -> Result<Self, ()> {
match s {
"allow" | "Allow" => Ok(Self::Allow),
"challenge" | "Challenge" => Ok(Self::Challenge),
"drop" | "Drop" => Ok(Self::Drop),
_ => Err(()),
}
}
}
#[derive(Clone, Debug)]
pub struct Policy {
pub name: String,