Struct InheritableField
pub struct InheritableField<T>where
T: Copy,{ /* private fields */ }Expand description
Wrapper for an individual inheritable property with $O(1)$ delta-mask tracking.
Implementations§
§impl<T> InheritableField<T>where
T: Copy,
impl<T> InheritableField<T>where
T: Copy,
pub const fn new(value: T, bit_flag: u64) -> InheritableField<T>
pub const fn new(value: T, bit_flag: u64) -> InheritableField<T>
Creates a new inheritable field initialized from the archetype default.
pub const fn get(&self) -> T
pub const fn get(&self) -> T
Reads the current value of the field.
pub const fn is_modified(&self) -> bool
pub const fn is_modified(&self) -> bool
Returns true if this field has been explicitly overridden on the instance.
pub fn set_override(&mut self, new_value: T, mask: &mut PrefabDeltaMask)
pub fn set_override(&mut self, new_value: T, mask: &mut PrefabDeltaMask)
Overrides the field value and sets its corresponding bit in mask.
pub fn inherit_from(&mut self, archetype_value: T, mask: PrefabDeltaMask)
pub fn inherit_from(&mut self, archetype_value: T, mask: PrefabDeltaMask)
Synchronizes this field with archetype_value if it has not been overridden.
pub fn reset_to_archetype(
&mut self,
archetype_value: T,
mask: &mut PrefabDeltaMask,
)
pub fn reset_to_archetype( &mut self, archetype_value: T, mask: &mut PrefabDeltaMask, )
Resets the override flag and restores archetype_value.
Trait Implementations§
§impl<T> Clone for InheritableField<T>
impl<T> Clone for InheritableField<T>
§fn clone(&self) -> InheritableField<T>
fn clone(&self) -> InheritableField<T>
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<T> Copy for InheritableField<T>where
T: Copy,
§impl<T> Debug for InheritableField<T>
impl<T> Debug for InheritableField<T>
impl<T> Eq for InheritableField<T>
§impl<T> PartialEq for InheritableField<T>
impl<T> PartialEq for InheritableField<T>
impl<T> StructuralPartialEq for InheritableField<T>
Auto Trait Implementations§
impl<T> Freeze for InheritableField<T>where
T: Freeze,
impl<T> RefUnwindSafe for InheritableField<T>where
T: RefUnwindSafe,
impl<T> Send for InheritableField<T>where
T: Send,
impl<T> Sync for InheritableField<T>where
T: Sync,
impl<T> Unpin for InheritableField<T>where
T: Unpin,
impl<T> UnsafeUnpin for InheritableField<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for InheritableField<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
Checks if this value is equivalent to the given key. Read more
§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.§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
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more