pub struct RuleConfig {
pub role_mask: RoleMaskConfig,
pub id: String,
pub endpoint: String,
pub methods: Vec<String>,
pub time: Option<TimeConfig>,
pub ip: Option<String>,
pub action: ActionConfig,
pub description: Option<String>,
pub priority: i32,
}Expand description
A single rule configuration.
Fields§
§role_mask: RoleMaskConfigRole bitmask. Use 0xFFFFFFFF for all roles, or specific bits like 0b11. Can be decimal (e.g., 3), hex (e.g., “0x3”), or binary string.
id: StringID to match. Use “*” for any ID.
endpoint: StringEndpoint pattern to match.
- “*” or “any” for all endpoints
- “/path/” (trailing slash) for prefix match
- “/path/**” for glob match
- “/path” for exact match
methods: Vec<String>HTTP methods to match (optional). Empty means all methods.
time: Option<TimeConfig>Time window configuration (optional).
ip: Option<String>IP address/CIDR to match (optional). “*” or omitted means any IP.
action: ActionConfigAction to take when rule matches.
description: Option<String>Optional description for logging/debugging.
priority: i32Priority (lower = higher priority). Rules are sorted by priority.
Trait Implementations§
Source§impl Clone for RuleConfig
impl Clone for RuleConfig
Source§fn clone(&self) -> RuleConfig
fn clone(&self) -> RuleConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RuleConfig
impl Debug for RuleConfig
Source§impl<'de> Deserialize<'de> for RuleConfig
impl<'de> Deserialize<'de> for RuleConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RuleConfig
impl RefUnwindSafe for RuleConfig
impl Send for RuleConfig
impl Sync for RuleConfig
impl Unpin for RuleConfig
impl UnwindSafe for RuleConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more