CodeData

Struct CodeData 

Source
pub struct CodeData {
Show 17 fields pub name: Option<String>, pub identifier: Option<String>, pub bukkit_name: Option<String>, pub item: Option<CodeIcon>, pub aliases: Option<Vec<String>>, pub codeblock_name: Option<String>, pub sub_action_blocks: Option<Vec<String>>, pub category: Option<String>, pub has_sub_categories: Option<bool>, pub tags: Option<Vec<CodeData>>, pub fields: Option<Vec<String>>, pub default_option: Option<String>, pub options: Option<Vec<CodeData>>, pub slot: Option<u8>, pub purchasables: Option<Vec<CodeData>>, pub price: Option<u16>, pub currency_type: Option<String>,
}
Expand description

A data element in the DiamondFire action dump.

Fields§

§name: Option<String>

The human readable name of this code item.

§identifier: Option<String>

The identifier of this code item.

§bukkit_name: Option<String>

The bukkit enum constant name for this code item.

Only applicable for particles, potions, and sounds.

§item: Option<CodeIcon>

The CodeIcon used to display this code item.

§aliases: Option<Vec<String>>

Alternate names that may be used to identify this code item.

§codeblock_name: Option<String>

The name of this codeblock.

§sub_action_blocks: Option<Vec<String>>§category: Option<String>

The category of this code item.

Only used for game values, particles, and sounds.

§has_sub_categories: Option<bool>

Whether this category has any sub-categories.

§tags: Option<Vec<CodeData>>

The tag options for this code item.

§fields: Option<Vec<String>>

The fields of this particle effect.

§default_option: Option<String>

The default option for this tag.

§options: Option<Vec<CodeData>>

The list of options in this tag.

§slot: Option<u8>

The slot this item goes in within an inventory.

§purchasables: Option<Vec<CodeData>>

The purchasable items within this shop.

§price: Option<u16>

The price of this shop item.

§currency_type: Option<String>

The currency used to purchase this shop item.

Implementations§

Source§

impl CodeData

Source

pub fn is_legacy(&self) -> bool

Returns whether this code item is considered legacy.

This forwards to the method on item if it is present, otherwise returning false.

Source

pub fn is_deprecated(&self) -> bool

Returns whether this code item is deprecated.

This forwards to the method on item if it is present, otherwise returning false.

Source

pub fn is_dynamic(&self) -> bool

Returns whether this code action is dynamic.

This occurs when a code block does not have any selectable actions but needs to take in options. This is tested by determining if the name is dynamic.

Trait Implementations§

Source§

impl Clone for CodeData

Source§

fn clone(&self) -> CodeData

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CodeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CodeData

Source§

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 Hash for CodeData

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CodeData

Source§

fn eq(&self, other: &CodeData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CodeData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for CodeData

Source§

impl StructuralPartialEq for CodeData

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,