pub struct PolicyRule {
pub name: String,
pub effect: PolicyEffect,
pub tool_patterns: Vec<String>,
pub fighter_patterns: Vec<String>,
pub scope: PolicyScope,
pub priority: i32,
pub conditions: Vec<PolicyCondition>,
pub description: String,
}Expand description
A single fight rule that controls which moves fighters can throw.
Rules are matched by glob patterns against tool names and fighter names, and can carry additional conditions (time windows, rate limits, capabilities).
Fields§
§name: StringHuman-readable name for this ring regulation.
effect: PolicyEffectWhether this rule allows or denies the move.
tool_patterns: Vec<String>Glob patterns matching tool (move) names. E.g. "shell_*", "file_write", "*".
fighter_patterns: Vec<String>Glob patterns matching fighter names. E.g. "*", "worker-*".
scope: PolicyScopeWhat level this rule applies at.
priority: i32Priority — higher priority rules are evaluated first. Default is 0.
conditions: Vec<PolicyCondition>Additional conditions that must be met for this rule to be active.
description: StringWhy this rule exists — the referee’s rationale.
Trait Implementations§
Source§impl Clone for PolicyRule
impl Clone for PolicyRule
Source§fn clone(&self) -> PolicyRule
fn clone(&self) -> PolicyRule
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 PolicyRule
impl Debug for PolicyRule
Source§impl<'de> Deserialize<'de> for PolicyRule
impl<'de> Deserialize<'de> for PolicyRule
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 PolicyRule
impl RefUnwindSafe for PolicyRule
impl Send for PolicyRule
impl Sync for PolicyRule
impl Unpin for PolicyRule
impl UnsafeUnpin for PolicyRule
impl UnwindSafe for PolicyRule
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