Enum initiative_core::world::field::Field
source · pub enum Field<T> {
Locked(Option<T>),
Unlocked(Option<T>),
}
Variants§
Implementations§
source§impl<T> Field<T>
impl<T> Field<T>
pub fn new(value: T) -> Self
pub fn is_locked(&self) -> bool
pub fn is_unlocked(&self) -> bool
pub fn lock(&mut self)
pub fn unlock(&mut self)
pub fn set_locked(&mut self, locked: bool)
pub fn replace(&mut self, value: T)
pub fn replace_with<F: FnOnce(Option<T>) -> T>(&mut self, f: F)
pub fn clear(&mut self)
pub fn value(&self) -> Option<&T>
pub fn value_mut(&mut self) -> Option<&mut T>
pub fn is_some(&self) -> bool
pub fn is_none(&self) -> bool
pub fn apply_diff(&mut self, other: &mut Self)
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Field<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Field<T>where
T: Deserialize<'de>,
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<T: PartialEq> PartialEq for Field<T>
impl<T: PartialEq> PartialEq for Field<T>
impl<T: Eq> Eq for Field<T>
Auto Trait Implementations§
impl<T> Freeze for Field<T>where
T: Freeze,
impl<T> RefUnwindSafe for Field<T>where
T: RefUnwindSafe,
impl<T> Send for Field<T>where
T: Send,
impl<T> Sync for Field<T>where
T: Sync,
impl<T> Unpin for Field<T>where
T: Unpin,
impl<T> UnwindSafe for Field<T>where
T: UnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)