aboutsummaryrefslogtreecommitdiff
path: root/src/rule.rs
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2025-03-20 16:22:29 +0100
committerHimbeer <himbeer@disroot.org>2025-03-20 16:22:29 +0100
commit77324961b27a9361ab8ebe2b8173af348242421a (patch)
treeb88c777a2b7bc929364ef81435d8f09c9bf4bc62 /src/rule.rs
parent9d55957b737cce1ace694376bdd157624286c020 (diff)
Derive Clone for route and rule descriptions
Diffstat (limited to 'src/rule.rs')
-rw-r--r--src/rule.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rule.rs b/src/rule.rs
index bd68c73..7b8d5cc 100644
--- a/src/rule.rs
+++ b/src/rule.rs
@@ -10,8 +10,8 @@ use netlink_packet_route::rule::RuleFlag;
use rtnetlink::RuleAddRequest;
/// A rule entry.
-#[derive(Debug)]
-pub struct Rule<T> {
+#[derive(Clone, Debug)]
+pub struct Rule<T: Clone> {
/// Whether to invert the matching criteria.
pub invert: bool,
/// Firewall mark to match against.
@@ -122,7 +122,7 @@ impl Rule<Ipv6Addr> {
}
}
-impl<T> Rule<T> {
+impl<T: Clone> Rule<T> {
fn prepare_add(&self, c: &Connection) -> RuleAddRequest {
let mut add = c.handle().rule().add().action(self.action);