pub struct Item {Show 14 fields
pub id: Uuid,
pub item_template_id: ItemTemplateId,
pub item_type: ItemType,
pub rarity: ItemRarity,
pub level: i64,
pub name: I18nString,
pub icon_url: String,
pub icon_path: String,
pub is_equipped: bool,
pub price: Vec<CurrencyUnit>,
pub experience: i64,
pub attributes: Vec<ItemAttribute>,
pub power_bonus: i32,
pub expires_at: Option<DateTime<Utc>>,
}Fields§
§id: Uuid§item_template_id: ItemTemplateId§item_type: ItemType§rarity: ItemRarity§level: i64§name: I18nString§icon_url: String§icon_path: String§is_equipped: bool§price: Vec<CurrencyUnit>§experience: i64§attributes: Vec<ItemAttribute>§power_bonus: i32Small symmetric power variance applied at roll time (seeded RNG, symmetric
around 0). Stored and loaded from the inventories.power_bonus column.
Existing items loaded without the column default to 0 (no jitter) via the
DEFAULT 0 migration. The jitter is added as a direct additive to the
computed character_power / item_power so it affects both the displayed
Combat-Power and the auto-equip comparison — two items from the same
template at the same level will show different power if their jitter differs.
expires_at: Option<DateTime<Utc>>Срок истечения временного предмета; None — постоянный. Истёкший
удаляется функцией sweep_expired_items.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Item
impl<'de> Deserialize<'de> for Item
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 FromWasmAbi for Itemwhere
Self: DeserializeOwned,
impl FromWasmAbi for Itemwhere
Self: DeserializeOwned,
Source§impl JsonSchema for Item
impl JsonSchema for Item
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl OptionFromWasmAbi for Itemwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for Itemwhere
Self: DeserializeOwned,
Source§impl RefFromWasmAbi for Itemwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for Itemwhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
The Wasm ABI type references to
Self are recovered from.Source§impl Tsify for Item
impl Tsify for Item
const DECL: &'static str = "export interface Item {\n id: Uuid;\n item_template_id: ItemTemplateId;\n item_type: ItemType;\n rarity: ItemRarity;\n level: number;\n name: I18nString;\n icon_url: string;\n icon_path: string;\n is_equipped: boolean;\n price: CurrencyUnit[];\n experience: number;\n attributes: ItemAttribute[];\n /**\n * Small symmetric power variance applied at roll time (seeded RNG, symmetric\n * around 0). Stored and loaded from the `inventories.power_bonus` column.\n * Existing items loaded without the column default to 0 (no jitter) via the\n * `DEFAULT 0` migration. The jitter is added as a direct additive to the\n * computed `character_power` / `item_power` so it affects both the displayed\n * Combat-Power and the auto-equip comparison \u{2014} two items from the same\n * template at the same level will show different power if their jitter differs.\n */\n power_bonus: number;\n /**\n * \u{421}\u{440}\u{43e}\u{43a} \u{438}\u{441}\u{442}\u{435}\u{447}\u{435}\u{43d}\u{438}\u{44f} \u{432}\u{440}\u{435}\u{43c}\u{435}\u{43d}\u{43d}\u{43e}\u{433}\u{43e} \u{43f}\u{440}\u{435}\u{434}\u{43c}\u{435}\u{442}\u{430}; `None` \u{2014} \u{43f}\u{43e}\u{441}\u{442}\u{43e}\u{44f}\u{43d}\u{43d}\u{44b}\u{439}. \u{418}\u{441}\u{442}\u{451}\u{43a}\u{448}\u{438}\u{439}\n * \u{443}\u{434}\u{430}\u{43b}\u{44f}\u{435}\u{442}\u{441}\u{44f} \u{444}\u{443}\u{43d}\u{43a}\u{446}\u{438}\u{435}\u{439} `sweep_expired_items`.\n */\n expires_at: DateTime<Utc> | null;\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl VectorFromWasmAbi for Itemwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for Itemwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
impl Eq for Item
impl StructuralPartialEq for Item
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnwindSafe for Item
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