pub enum Rule {
Ban(Id),
Unban(Id),
Value {
name: Id,
value: String,
},
Repeal(Id),
}Expand description
A single rule that must be validated before a battle starts.
Variants§
Ban(Id)
Bans something, such as a Mon, item, move, or ability. Serialized as - ID.
Unban(Id)
Unbans something, such as a Mon, item, move, or ability. Serialized as + ID.
An unban is used to override a ban rule that is typically more general. For example, - Legendary, + Giratina would allow the Mon Giratina to be used, even though it is a
legendary.
Value
Some other rule attached to a value. Serialized as name = value.
If value is empty, then the rule is simply serialized as name.
Repeal(Id)
Repeals a previously established rule. Serialized as ! name.
Compound and single rules can be repealed. Bans and unbans cannot be repealed.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rule
impl<'de> Deserialize<'de> for Rule
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
impl Eq for Rule
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.