DataComponentUnion

Union DataComponentUnion 

Source
pub union DataComponentUnion {
    /* private fields */
}
Expand description

A union of all data components.

You probably don’t want to use this directly. Consider DataComponentPatch instead.

This type does not know its own value, and as such every function for it requires the DataComponentKind to be passed in. Passing the wrong DataComponentKind will result in undefined behavior. Also, all of the values are ManuallyDrop.

Implementations§

Source§

impl DataComponentUnion

Source

pub unsafe fn serialize_entry_as<S>( &self, serializer: &mut S, kind: DataComponentKind, ) -> Result<(), <S as SerializeMap>::Error>
where S: SerializeMap,

§Safety

kind must be the correct value for this union.

Source

pub unsafe fn drop_as(&mut self, kind: DataComponentKind)

§Safety

kind must be the correct value for this union.

Source

pub unsafe fn as_kind( &self, kind: DataComponentKind, ) -> &(dyn EncodableDataComponent + 'static)

§Safety

kind must be the correct value for this union.

Source

pub fn azalea_read_as( kind: DataComponentKind, buf: &mut Cursor<&[u8]>, ) -> Result<DataComponentUnion, BufReadError>

Source

pub unsafe fn azalea_write_as( &self, kind: DataComponentKind, buf: &mut impl Write, ) -> Result<(), Error>

§Safety

kind must be the correct value for this union.

Source

pub unsafe fn clone_as(&self, kind: DataComponentKind) -> DataComponentUnion

§Safety

kind must be the correct value for this union.

Source

pub unsafe fn eq_as( &self, other: &DataComponentUnion, kind: DataComponentKind, ) -> bool

§Safety

kind must be the correct value for this union.

Trait Implementations§

Source§

impl From<AttributeModifiers> for DataComponentUnion

Source§

fn from(value: AttributeModifiers) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<AxolotlVariant> for DataComponentUnion

Source§

fn from(value: AxolotlVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<BannerPatterns> for DataComponentUnion

Source§

fn from(value: BannerPatterns) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<BaseColor> for DataComponentUnion

Source§

fn from(value: BaseColor) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Bees> for DataComponentUnion

Source§

fn from(value: Bees) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<BlockEntityData> for DataComponentUnion

Source§

fn from(value: BlockEntityData) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<BlockState> for DataComponentUnion

Source§

fn from(value: BlockState) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<BlocksAttacks> for DataComponentUnion

Source§

fn from(value: BlocksAttacks) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<BreakSound> for DataComponentUnion

Source§

fn from(value: BreakSound) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<BucketEntityData> for DataComponentUnion

Source§

fn from(value: BucketEntityData) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<BundleContents> for DataComponentUnion

Source§

fn from(value: BundleContents) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<CanBreak> for DataComponentUnion

Source§

fn from(value: CanBreak) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<CanPlaceOn> for DataComponentUnion

Source§

fn from(value: CanPlaceOn) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<CatCollar> for DataComponentUnion

Source§

fn from(value: CatCollar) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<CatVariant> for DataComponentUnion

Source§

fn from(value: CatVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<ChargedProjectiles> for DataComponentUnion

Source§

fn from(value: ChargedProjectiles) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<ChickenVariant> for DataComponentUnion

Source§

fn from(value: ChickenVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Consumable> for DataComponentUnion

Source§

fn from(value: Consumable) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Container> for DataComponentUnion

Source§

fn from(value: Container) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<ContainerLoot> for DataComponentUnion

Source§

fn from(value: ContainerLoot) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<CowVariant> for DataComponentUnion

Source§

fn from(value: CowVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<CreativeSlotLock> for DataComponentUnion

Source§

fn from(value: CreativeSlotLock) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<CustomData> for DataComponentUnion

Source§

fn from(value: CustomData) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<CustomModelData> for DataComponentUnion

Source§

fn from(value: CustomModelData) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<CustomName> for DataComponentUnion

Source§

fn from(value: CustomName) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Damage> for DataComponentUnion

Source§

fn from(value: Damage) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<DamageResistant> for DataComponentUnion

Source§

fn from(value: DamageResistant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<DeathProtection> for DataComponentUnion

Source§

fn from(value: DeathProtection) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<DebugStickState> for DataComponentUnion

Source§

fn from(value: DebugStickState) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<DyedColor> for DataComponentUnion

Source§

fn from(value: DyedColor) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Enchantable> for DataComponentUnion

Source§

fn from(value: Enchantable) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<EnchantmentGlintOverride> for DataComponentUnion

Source§

fn from(value: EnchantmentGlintOverride) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Enchantments> for DataComponentUnion

Source§

fn from(value: Enchantments) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<EntityData> for DataComponentUnion

Source§

fn from(value: EntityData) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Equippable> for DataComponentUnion

Source§

fn from(value: Equippable) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<FireworkExplosion> for DataComponentUnion

Source§

fn from(value: FireworkExplosion) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Fireworks> for DataComponentUnion

Source§

fn from(value: Fireworks) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Food> for DataComponentUnion

Source§

fn from(value: Food) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<FoxVariant> for DataComponentUnion

Source§

fn from(value: FoxVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<FrogVariant> for DataComponentUnion

Source§

fn from(value: FrogVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Glider> for DataComponentUnion

Source§

fn from(value: Glider) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<HorseVariant> for DataComponentUnion

Source§

fn from(value: HorseVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Instrument> for DataComponentUnion

Source§

fn from(value: Instrument) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<IntangibleProjectile> for DataComponentUnion

Source§

fn from(value: IntangibleProjectile) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<ItemModel> for DataComponentUnion

Source§

fn from(value: ItemModel) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<ItemName> for DataComponentUnion

Source§

fn from(value: ItemName) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<JukeboxPlayable> for DataComponentUnion

Source§

fn from(value: JukeboxPlayable) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<LlamaVariant> for DataComponentUnion

Source§

fn from(value: LlamaVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Lock> for DataComponentUnion

Source§

fn from(value: Lock) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<LodestoneTracker> for DataComponentUnion

Source§

fn from(value: LodestoneTracker) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Lore> for DataComponentUnion

Source§

fn from(value: Lore) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<MapColor> for DataComponentUnion

Source§

fn from(value: MapColor) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<MapDecorations> for DataComponentUnion

Source§

fn from(value: MapDecorations) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<MapId> for DataComponentUnion

Source§

fn from(value: MapId) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<MapPostProcessing> for DataComponentUnion

Source§

fn from(value: MapPostProcessing) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<MaxDamage> for DataComponentUnion

Source§

fn from(value: MaxDamage) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<MaxStackSize> for DataComponentUnion

Source§

fn from(value: MaxStackSize) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<MooshroomVariant> for DataComponentUnion

Source§

fn from(value: MooshroomVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<NoteBlockSound> for DataComponentUnion

Source§

fn from(value: NoteBlockSound) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<OminousBottleAmplifier> for DataComponentUnion

Source§

fn from(value: OminousBottleAmplifier) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<PaintingVariant> for DataComponentUnion

Source§

fn from(value: PaintingVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<ParrotVariant> for DataComponentUnion

Source§

fn from(value: ParrotVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<PigVariant> for DataComponentUnion

Source§

fn from(value: PigVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<PotDecorations> for DataComponentUnion

Source§

fn from(value: PotDecorations) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<PotionContents> for DataComponentUnion

Source§

fn from(value: PotionContents) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<PotionDurationScale> for DataComponentUnion

Source§

fn from(value: PotionDurationScale) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Profile> for DataComponentUnion

Source§

fn from(value: Profile) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<ProvidesBannerPatterns> for DataComponentUnion

Source§

fn from(value: ProvidesBannerPatterns) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<ProvidesTrimMaterial> for DataComponentUnion

Source§

fn from(value: ProvidesTrimMaterial) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<RabbitVariant> for DataComponentUnion

Source§

fn from(value: RabbitVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Rarity> for DataComponentUnion

Source§

fn from(value: Rarity) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Recipes> for DataComponentUnion

Source§

fn from(value: Recipes) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<RepairCost> for DataComponentUnion

Source§

fn from(value: RepairCost) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Repairable> for DataComponentUnion

Source§

fn from(value: Repairable) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<SalmonSize> for DataComponentUnion

Source§

fn from(value: SalmonSize) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<SheepColor> for DataComponentUnion

Source§

fn from(value: SheepColor) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<ShulkerColor> for DataComponentUnion

Source§

fn from(value: ShulkerColor) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<StoredEnchantments> for DataComponentUnion

Source§

fn from(value: StoredEnchantments) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<SuspiciousStewEffects> for DataComponentUnion

Source§

fn from(value: SuspiciousStewEffects) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Tool> for DataComponentUnion

Source§

fn from(value: Tool) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<TooltipDisplay> for DataComponentUnion

Source§

fn from(value: TooltipDisplay) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<TooltipStyle> for DataComponentUnion

Source§

fn from(value: TooltipStyle) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Trim> for DataComponentUnion

Source§

fn from(value: Trim) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<TropicalFishBaseColor> for DataComponentUnion

Source§

fn from(value: TropicalFishBaseColor) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<TropicalFishPattern> for DataComponentUnion

Source§

fn from(value: TropicalFishPattern) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<TropicalFishPatternColor> for DataComponentUnion

Source§

fn from(value: TropicalFishPatternColor) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Unbreakable> for DataComponentUnion

Source§

fn from(value: Unbreakable) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<UseCooldown> for DataComponentUnion

Source§

fn from(value: UseCooldown) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<UseRemainder> for DataComponentUnion

Source§

fn from(value: UseRemainder) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<VillagerVariant> for DataComponentUnion

Source§

fn from(value: VillagerVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<Weapon> for DataComponentUnion

Source§

fn from(value: Weapon) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<WolfCollar> for DataComponentUnion

Source§

fn from(value: WolfCollar) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<WolfSoundVariant> for DataComponentUnion

Source§

fn from(value: WolfSoundVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<WolfVariant> for DataComponentUnion

Source§

fn from(value: WolfVariant) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<WritableBookContent> for DataComponentUnion

Source§

fn from(value: WritableBookContent) -> DataComponentUnion

Converts to this type from the input type.
Source§

impl From<WrittenBookContent> for DataComponentUnion

Source§

fn from(value: WrittenBookContent) -> DataComponentUnion

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ConditionalSend for T
where T: Send,

§

impl<T> ErasedDestructor for T
where T: 'static,