pub struct EconItem {
pub assetid: u64,
pub classid: u64,
pub instanceid: u64,
pub appid: u32,
pub contextid: u64,
pub amount: u32,
pub pos: Option<u32>,
pub desc: Arc<InventoryDescription>,
pub owner_steam_id: Option<SteamID>,
}Expand description
An item in a Steam inventory (merged asset + description).
Fields§
§assetid: u64Asset ID (unique within inventory).
classid: u64Class ID.
instanceid: u64Instance ID.
appid: u32App ID the item belongs to.
contextid: u64Context ID within the app.
amount: u32Stack amount.
pos: Option<u32>Position in inventory.
desc: Arc<InventoryDescription>Shared reference to the item’s complex metadata (name, tags, colors, etc.). Many items in an inventory (e.g., 100 identical cases) share the same classid/instanceid and therefore the exact same description data. Pointing to an Arc avoids massive duplicate allocations.
owner_steam_id: Option<SteamID>The Steam64 ID of the account that owns this item. Propagated immediately after network fetch.
Implementations§
Source§impl EconItem
impl EconItem
Sourcepub fn try_from_inventory_data(
asset: &InventoryAsset,
desc: Arc<InventoryDescription>,
) -> Result<Self, SteamUserError>
pub fn try_from_inventory_data( asset: &InventoryAsset, desc: Arc<InventoryDescription>, ) -> Result<Self, SteamUserError>
Create an EconItem from a typed asset and a shared description.
Returns Err(SteamUserError::MalformedResponse) if any of the integer
ID fields fail to parse. Use this instead of silently substituting
zeros — a zero assetid/classid/instanceid is a real Steam value
(default/empty) and would otherwise be indistinguishable from a parse
failure.
Sourcepub fn get_icon_url(&self) -> String
pub fn get_icon_url(&self) -> String
Get the full icon URL.
Sourcepub fn is_listed_on_market(&self) -> bool
pub fn is_listed_on_market(&self) -> bool
Returns true if this item is currently listed on the Steam Community
Market. Mirrors Steam JS: if (description.sealed && description.sealed_type == 1) Note: sealed: 0 is falsy in JS, so
we must check != 0.
Sourcepub fn is_trade_protected(&self) -> bool
pub fn is_trade_protected(&self) -> bool
Returns true if the item is trade protected (provisional), meaning it
cannot be modified, consumed, or transferred.
Mirrors Steam JS: else if (description.sealed) — sealed is truthy
(non-zero) but not listed.
Sourcepub fn is_container(&self) -> bool
pub fn is_container(&self) -> bool
Returns true when this item is a container (weapon case / capsule /
sticker pack / etc.). Delegates to
InventoryDescription::is_container.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EconItem
impl<'de> Deserialize<'de> for EconItem
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>,
Auto Trait Implementations§
impl Freeze for EconItem
impl RefUnwindSafe for EconItem
impl Send for EconItem
impl Sync for EconItem
impl Unpin for EconItem
impl UnsafeUnpin for EconItem
impl UnwindSafe for EconItem
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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>
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 more