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: SerializeMap>( &self, serializer: &mut S, kind: DataComponentKind, ) -> Result<(), S::Error>

§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

§Safety

kind must be the correct value for this union.

Source

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

Source

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

§Safety

kind must be the correct value for this union.

Source

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

§Safety

kind must be the correct value for this union.

Source

pub unsafe fn eq_as(&self, other: &Self, 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) -> Self

Converts to this type from the input type.
Source§

impl From<AxolotlVariant> for DataComponentUnion

Source§

fn from(value: AxolotlVariant) -> Self

Converts to this type from the input type.
Source§

impl From<BannerPatterns> for DataComponentUnion

Source§

fn from(value: BannerPatterns) -> Self

Converts to this type from the input type.
Source§

impl From<BaseColor> for DataComponentUnion

Source§

fn from(value: BaseColor) -> Self

Converts to this type from the input type.
Source§

impl From<Bees> for DataComponentUnion

Source§

fn from(value: Bees) -> Self

Converts to this type from the input type.
Source§

impl From<BlockEntityData> for DataComponentUnion

Source§

fn from(value: BlockEntityData) -> Self

Converts to this type from the input type.
Source§

impl From<BlockState> for DataComponentUnion

Source§

fn from(value: BlockState) -> Self

Converts to this type from the input type.
Source§

impl From<BlocksAttacks> for DataComponentUnion

Source§

fn from(value: BlocksAttacks) -> Self

Converts to this type from the input type.
Source§

impl From<BreakSound> for DataComponentUnion

Source§

fn from(value: BreakSound) -> Self

Converts to this type from the input type.
Source§

impl From<BucketEntityData> for DataComponentUnion

Source§

fn from(value: BucketEntityData) -> Self

Converts to this type from the input type.
Source§

impl From<BundleContents> for DataComponentUnion

Source§

fn from(value: BundleContents) -> Self

Converts to this type from the input type.
Source§

impl From<CanBreak> for DataComponentUnion

Source§

fn from(value: CanBreak) -> Self

Converts to this type from the input type.
Source§

impl From<CanPlaceOn> for DataComponentUnion

Source§

fn from(value: CanPlaceOn) -> Self

Converts to this type from the input type.
Source§

impl From<CatCollar> for DataComponentUnion

Source§

fn from(value: CatCollar) -> Self

Converts to this type from the input type.
Source§

impl From<CatVariant> for DataComponentUnion

Source§

fn from(value: CatVariant) -> Self

Converts to this type from the input type.
Source§

impl From<ChargedProjectiles> for DataComponentUnion

Source§

fn from(value: ChargedProjectiles) -> Self

Converts to this type from the input type.
Source§

impl From<ChickenVariant> for DataComponentUnion

Source§

fn from(value: ChickenVariant) -> Self

Converts to this type from the input type.
Source§

impl From<Consumable> for DataComponentUnion

Source§

fn from(value: Consumable) -> Self

Converts to this type from the input type.
Source§

impl From<Container> for DataComponentUnion

Source§

fn from(value: Container) -> Self

Converts to this type from the input type.
Source§

impl From<ContainerLoot> for DataComponentUnion

Source§

fn from(value: ContainerLoot) -> Self

Converts to this type from the input type.
Source§

impl From<CowVariant> for DataComponentUnion

Source§

fn from(value: CowVariant) -> Self

Converts to this type from the input type.
Source§

impl From<CreativeSlotLock> for DataComponentUnion

Source§

fn from(value: CreativeSlotLock) -> Self

Converts to this type from the input type.
Source§

impl From<CustomData> for DataComponentUnion

Source§

fn from(value: CustomData) -> Self

Converts to this type from the input type.
Source§

impl From<CustomModelData> for DataComponentUnion

Source§

fn from(value: CustomModelData) -> Self

Converts to this type from the input type.
Source§

impl From<CustomName> for DataComponentUnion

Source§

fn from(value: CustomName) -> Self

Converts to this type from the input type.
Source§

impl From<Damage> for DataComponentUnion

Source§

fn from(value: Damage) -> Self

Converts to this type from the input type.
Source§

impl From<DamageResistant> for DataComponentUnion

Source§

fn from(value: DamageResistant) -> Self

Converts to this type from the input type.
Source§

impl From<DeathProtection> for DataComponentUnion

Source§

fn from(value: DeathProtection) -> Self

Converts to this type from the input type.
Source§

impl From<DebugStickState> for DataComponentUnion

Source§

fn from(value: DebugStickState) -> Self

Converts to this type from the input type.
Source§

impl From<DyedColor> for DataComponentUnion

Source§

fn from(value: DyedColor) -> Self

Converts to this type from the input type.
Source§

impl From<Enchantable> for DataComponentUnion

Source§

fn from(value: Enchantable) -> Self

Converts to this type from the input type.
Source§

impl From<EnchantmentGlintOverride> for DataComponentUnion

Source§

fn from(value: EnchantmentGlintOverride) -> Self

Converts to this type from the input type.
Source§

impl From<Enchantments> for DataComponentUnion

Source§

fn from(value: Enchantments) -> Self

Converts to this type from the input type.
Source§

impl From<EntityData> for DataComponentUnion

Source§

fn from(value: EntityData) -> Self

Converts to this type from the input type.
Source§

impl From<Equippable> for DataComponentUnion

Source§

fn from(value: Equippable) -> Self

Converts to this type from the input type.
Source§

impl From<FireworkExplosion> for DataComponentUnion

Source§

fn from(value: FireworkExplosion) -> Self

Converts to this type from the input type.
Source§

impl From<Fireworks> for DataComponentUnion

Source§

fn from(value: Fireworks) -> Self

Converts to this type from the input type.
Source§

impl From<Food> for DataComponentUnion

Source§

fn from(value: Food) -> Self

Converts to this type from the input type.
Source§

impl From<FoxVariant> for DataComponentUnion

Source§

fn from(value: FoxVariant) -> Self

Converts to this type from the input type.
Source§

impl From<FrogVariant> for DataComponentUnion

Source§

fn from(value: FrogVariant) -> Self

Converts to this type from the input type.
Source§

impl From<Glider> for DataComponentUnion

Source§

fn from(value: Glider) -> Self

Converts to this type from the input type.
Source§

impl From<HorseVariant> for DataComponentUnion

Source§

fn from(value: HorseVariant) -> Self

Converts to this type from the input type.
Source§

impl From<Instrument> for DataComponentUnion

Source§

fn from(value: Instrument) -> Self

Converts to this type from the input type.
Source§

impl From<IntangibleProjectile> for DataComponentUnion

Source§

fn from(value: IntangibleProjectile) -> Self

Converts to this type from the input type.
Source§

impl From<ItemModel> for DataComponentUnion

Source§

fn from(value: ItemModel) -> Self

Converts to this type from the input type.
Source§

impl From<ItemName> for DataComponentUnion

Source§

fn from(value: ItemName) -> Self

Converts to this type from the input type.
Source§

impl From<JukeboxPlayable> for DataComponentUnion

Source§

fn from(value: JukeboxPlayable) -> Self

Converts to this type from the input type.
Source§

impl From<LlamaVariant> for DataComponentUnion

Source§

fn from(value: LlamaVariant) -> Self

Converts to this type from the input type.
Source§

impl From<Lock> for DataComponentUnion

Source§

fn from(value: Lock) -> Self

Converts to this type from the input type.
Source§

impl From<LodestoneTracker> for DataComponentUnion

Source§

fn from(value: LodestoneTracker) -> Self

Converts to this type from the input type.
Source§

impl From<Lore> for DataComponentUnion

Source§

fn from(value: Lore) -> Self

Converts to this type from the input type.
Source§

impl From<MapColor> for DataComponentUnion

Source§

fn from(value: MapColor) -> Self

Converts to this type from the input type.
Source§

impl From<MapDecorations> for DataComponentUnion

Source§

fn from(value: MapDecorations) -> Self

Converts to this type from the input type.
Source§

impl From<MapId> for DataComponentUnion

Source§

fn from(value: MapId) -> Self

Converts to this type from the input type.
Source§

impl From<MapPostProcessing> for DataComponentUnion

Source§

fn from(value: MapPostProcessing) -> Self

Converts to this type from the input type.
Source§

impl From<MaxDamage> for DataComponentUnion

Source§

fn from(value: MaxDamage) -> Self

Converts to this type from the input type.
Source§

impl From<MaxStackSize> for DataComponentUnion

Source§

fn from(value: MaxStackSize) -> Self

Converts to this type from the input type.
Source§

impl From<MooshroomVariant> for DataComponentUnion

Source§

fn from(value: MooshroomVariant) -> Self

Converts to this type from the input type.
Source§

impl From<NoteBlockSound> for DataComponentUnion

Source§

fn from(value: NoteBlockSound) -> Self

Converts to this type from the input type.
Source§

impl From<OminousBottleAmplifier> for DataComponentUnion

Source§

fn from(value: OminousBottleAmplifier) -> Self

Converts to this type from the input type.
Source§

impl From<PaintingVariant> for DataComponentUnion

Source§

fn from(value: PaintingVariant) -> Self

Converts to this type from the input type.
Source§

impl From<ParrotVariant> for DataComponentUnion

Source§

fn from(value: ParrotVariant) -> Self

Converts to this type from the input type.
Source§

impl From<PigVariant> for DataComponentUnion

Source§

fn from(value: PigVariant) -> Self

Converts to this type from the input type.
Source§

impl From<PotDecorations> for DataComponentUnion

Source§

fn from(value: PotDecorations) -> Self

Converts to this type from the input type.
Source§

impl From<PotionContents> for DataComponentUnion

Source§

fn from(value: PotionContents) -> Self

Converts to this type from the input type.
Source§

impl From<PotionDurationScale> for DataComponentUnion

Source§

fn from(value: PotionDurationScale) -> Self

Converts to this type from the input type.
Source§

impl From<Profile> for DataComponentUnion

Source§

fn from(value: Profile) -> Self

Converts to this type from the input type.
Source§

impl From<ProvidesBannerPatterns> for DataComponentUnion

Source§

fn from(value: ProvidesBannerPatterns) -> Self

Converts to this type from the input type.
Source§

impl From<ProvidesTrimMaterial> for DataComponentUnion

Source§

fn from(value: ProvidesTrimMaterial) -> Self

Converts to this type from the input type.
Source§

impl From<RabbitVariant> for DataComponentUnion

Source§

fn from(value: RabbitVariant) -> Self

Converts to this type from the input type.
Source§

impl From<Rarity> for DataComponentUnion

Source§

fn from(value: Rarity) -> Self

Converts to this type from the input type.
Source§

impl From<Recipes> for DataComponentUnion

Source§

fn from(value: Recipes) -> Self

Converts to this type from the input type.
Source§

impl From<RepairCost> for DataComponentUnion

Source§

fn from(value: RepairCost) -> Self

Converts to this type from the input type.
Source§

impl From<Repairable> for DataComponentUnion

Source§

fn from(value: Repairable) -> Self

Converts to this type from the input type.
Source§

impl From<SalmonSize> for DataComponentUnion

Source§

fn from(value: SalmonSize) -> Self

Converts to this type from the input type.
Source§

impl From<SheepColor> for DataComponentUnion

Source§

fn from(value: SheepColor) -> Self

Converts to this type from the input type.
Source§

impl From<ShulkerColor> for DataComponentUnion

Source§

fn from(value: ShulkerColor) -> Self

Converts to this type from the input type.
Source§

impl From<StoredEnchantments> for DataComponentUnion

Source§

fn from(value: StoredEnchantments) -> Self

Converts to this type from the input type.
Source§

impl From<SuspiciousStewEffects> for DataComponentUnion

Source§

fn from(value: SuspiciousStewEffects) -> Self

Converts to this type from the input type.
Source§

impl From<Tool> for DataComponentUnion

Source§

fn from(value: Tool) -> Self

Converts to this type from the input type.
Source§

impl From<TooltipDisplay> for DataComponentUnion

Source§

fn from(value: TooltipDisplay) -> Self

Converts to this type from the input type.
Source§

impl From<TooltipStyle> for DataComponentUnion

Source§

fn from(value: TooltipStyle) -> Self

Converts to this type from the input type.
Source§

impl From<Trim> for DataComponentUnion

Source§

fn from(value: Trim) -> Self

Converts to this type from the input type.
Source§

impl From<TropicalFishBaseColor> for DataComponentUnion

Source§

fn from(value: TropicalFishBaseColor) -> Self

Converts to this type from the input type.
Source§

impl From<TropicalFishPattern> for DataComponentUnion

Source§

fn from(value: TropicalFishPattern) -> Self

Converts to this type from the input type.
Source§

impl From<TropicalFishPatternColor> for DataComponentUnion

Source§

fn from(value: TropicalFishPatternColor) -> Self

Converts to this type from the input type.
Source§

impl From<Unbreakable> for DataComponentUnion

Source§

fn from(value: Unbreakable) -> Self

Converts to this type from the input type.
Source§

impl From<UseCooldown> for DataComponentUnion

Source§

fn from(value: UseCooldown) -> Self

Converts to this type from the input type.
Source§

impl From<UseRemainder> for DataComponentUnion

Source§

fn from(value: UseRemainder) -> Self

Converts to this type from the input type.
Source§

impl From<VillagerVariant> for DataComponentUnion

Source§

fn from(value: VillagerVariant) -> Self

Converts to this type from the input type.
Source§

impl From<Weapon> for DataComponentUnion

Source§

fn from(value: Weapon) -> Self

Converts to this type from the input type.
Source§

impl From<WolfCollar> for DataComponentUnion

Source§

fn from(value: WolfCollar) -> Self

Converts to this type from the input type.
Source§

impl From<WolfSoundVariant> for DataComponentUnion

Source§

fn from(value: WolfSoundVariant) -> Self

Converts to this type from the input type.
Source§

impl From<WolfVariant> for DataComponentUnion

Source§

fn from(value: WolfVariant) -> Self

Converts to this type from the input type.
Source§

impl From<WritableBookContent> for DataComponentUnion

Source§

fn from(value: WritableBookContent) -> Self

Converts to this type from the input type.
Source§

impl From<WrittenBookContent> for DataComponentUnion

Source§

fn from(value: WrittenBookContent) -> Self

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> 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.

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<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,