mirror of
https://github.com/nftables-rs/nftables-rs.git
synced 2026-10-19 16:01:31 +00:00
fix(stmt)!: match anonymous and named quotas
This commit is contained in:
+12
-4
@@ -33,10 +33,8 @@ pub enum Statement {
|
||||
/// anonymous or named counter.
|
||||
Counter(Counter),
|
||||
Mangle(Mangle),
|
||||
Quota(Quota),
|
||||
#[serde(rename = "quota")]
|
||||
/// reference to a named quota object
|
||||
QuotaRef(String),
|
||||
/// anonymous or named quota.
|
||||
Quota(QuotaOrQuotaRef),
|
||||
// TODO: last
|
||||
Limit(Limit),
|
||||
|
||||
@@ -155,6 +153,16 @@ pub struct Mangle {
|
||||
pub value: Expression,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
/// Represents an anonymous or named quota object.
|
||||
pub enum QuotaOrQuotaRef {
|
||||
/// Anonymous quota object.
|
||||
Quota(Quota),
|
||||
/// Reference to a named quota object.
|
||||
QuotaRef(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
|
||||
/// Creates an anonymous quota which lives in the rule it appears in.
|
||||
pub struct Quota {
|
||||
|
||||
Reference in New Issue
Block a user