pub enum GameRuleValue {
Bool(bool),
Int(i32),
}Expand description
A game rule value - either a boolean or an integer.
Variants§
Implementations§
Source§impl GameRuleValue
impl GameRuleValue
Sourcepub fn matches_type(&self, value_type: GameRuleType) -> bool
pub fn matches_type(&self, value_type: GameRuleType) -> bool
Returns true if this value matches the given type.
Trait Implementations§
Source§impl Clone for GameRuleValue
impl Clone for GameRuleValue
Source§fn clone(&self) -> GameRuleValue
fn clone(&self) -> GameRuleValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GameRuleValue
Source§impl Debug for GameRuleValue
impl Debug for GameRuleValue
Source§impl<'de> Deserialize<'de> for GameRuleValue
impl<'de> Deserialize<'de> for GameRuleValue
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 Display for GameRuleValue
impl Display for GameRuleValue
impl Eq for GameRuleValue
Source§impl PartialEq for GameRuleValue
impl PartialEq for GameRuleValue
Source§fn eq(&self, other: &GameRuleValue) -> bool
fn eq(&self, other: &GameRuleValue) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for GameRuleValue
impl Serialize for GameRuleValue
impl StructuralPartialEq for GameRuleValue
Auto Trait Implementations§
impl Freeze for GameRuleValue
impl RefUnwindSafe for GameRuleValue
impl Send for GameRuleValue
impl Sync for GameRuleValue
impl Unpin for GameRuleValue
impl UnsafeUnpin for GameRuleValue
impl UnwindSafe for GameRuleValue
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.