pub enum PolicyCondition {
TimeWindow {
start_hour: u8,
end_hour: u8,
},
MaxInvocations {
count: u32,
window_secs: u64,
},
RequireCapability {
capability: String,
},
}Expand description
Additional conditions that must be met for a policy rule to be active. These are the fine print in the fight contract.
Variants§
TimeWindow
Rule is only active during certain hours (UTC). The fighter can only throw this move during the scheduled bout window.
Fields
MaxInvocations
Rate limit — maximum invocations within a rolling time window. Prevents a fighter from spamming the same move.
Fields
RequireCapability
The fighter must possess this capability to match this rule. Like requiring a certain belt rank to enter the ring.
Trait Implementations§
Source§impl Clone for PolicyCondition
impl Clone for PolicyCondition
Source§fn clone(&self) -> PolicyCondition
fn clone(&self) -> PolicyCondition
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 PolicyCondition
impl Debug for PolicyCondition
Source§impl<'de> Deserialize<'de> for PolicyCondition
impl<'de> Deserialize<'de> for PolicyCondition
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
Source§impl PartialEq for PolicyCondition
impl PartialEq for PolicyCondition
Source§impl Serialize for PolicyCondition
impl Serialize for PolicyCondition
impl Eq for PolicyCondition
impl StructuralPartialEq for PolicyCondition
Auto Trait Implementations§
impl Freeze for PolicyCondition
impl RefUnwindSafe for PolicyCondition
impl Send for PolicyCondition
impl Sync for PolicyCondition
impl Unpin for PolicyCondition
impl UnsafeUnpin for PolicyCondition
impl UnwindSafe for PolicyCondition
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.