#[non_exhaustive]
#[derive(Clone, Copy)]
pub enum Action {
Pass,
Drop,
Copy {
take: Option<u32>,
},
Route,
}
impl Action {
pub const COPY_ALL: Action = Action::Copy { take: None };
pub(crate) fn into_common_action(self) -> (push_packet_common::Action, Option<u32>) {
match self {
Self::Pass => (push_packet_common::Action::Pass, None),
Self::Drop => (push_packet_common::Action::Drop, None),
Self::Copy { take } => (push_packet_common::Action::Copy, take),
Self::Route => (push_packet_common::Action::Route, None),
}
}
}