Config
This commit is contained in:
parent
ceebd53626
commit
5dc6ca05ce
6 changed files with 187 additions and 24 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue