pub struct ConsumeEffectData {
effect_type: ConsumeEffectTypeRef,
value: Box<dyn ErasedConsumeEffect>,
}Expand description
One type-erased but keyed consume-effect value.
Fields§
§effect_type: ConsumeEffectTypeRef§value: Box<dyn ErasedConsumeEffect>Implementations§
Source§impl ConsumeEffectData
impl ConsumeEffectData
pub fn new<T: ConsumeEffectCodec>( effect_type: ConsumeEffectTypeRef, value: T, ) -> Self
pub const fn effect_type(&self) -> ConsumeEffectTypeRef
pub fn downcast_ref<T: DowncastType>(&self) -> Option<&T>
pub(crate) fn to_nbt_tag_ref(&self) -> NbtTag
pub(crate) fn from_owned_nbt(tag: &NbtTag) -> Option<Self>
Trait Implementations§
Source§impl Clone for ConsumeEffectData
impl Clone for ConsumeEffectData
Source§impl Debug for ConsumeEffectData
impl Debug for ConsumeEffectData
Source§impl HashComponent for ConsumeEffectData
impl HashComponent for ConsumeEffectData
Source§fn hash_component(&self, hasher: &mut ComponentHasher)
fn hash_component(&self, hasher: &mut ComponentHasher)
Hashes this value into the given hasher.
Source§fn compute_hash(&self) -> i32
fn compute_hash(&self) -> i32
Computes the hash of this value.
Source§impl PartialEq for ConsumeEffectData
impl PartialEq for ConsumeEffectData
Source§impl ReadFrom for ConsumeEffectData
impl ReadFrom for ConsumeEffectData
Auto Trait Implementations§
impl !RefUnwindSafe for ConsumeEffectData
impl !UnwindSafe for ConsumeEffectData
impl Freeze for ConsumeEffectData
impl Send for ConsumeEffectData
impl Sync for ConsumeEffectData
impl Unpin for ConsumeEffectData
impl UnsafeUnpin for ConsumeEffectData
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> 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 moreWraps this value in an
Arc<SyncMutex<>>