Skip to main content

ItemInstanceView

Trait ItemInstanceView 

Source
trait ItemInstanceView {
    // Required methods
    fn item_ref(&self) -> ItemRef;
    fn item_count(&self) -> i32;
    fn effective_value_raw(&self, key: &Identifier) -> Option<&ComponentData>;

    // Provided method
    fn component<T: Component + DowncastType>(
        &self,
        component: DataComponentType<T>,
    ) -> Option<&T> { ... }
}

Required Methods§

Source

fn item_ref(&self) -> ItemRef

Source

fn item_count(&self) -> i32

Source

fn effective_value_raw(&self, key: &Identifier) -> Option<&ComponentData>

Provided Methods§

Source

fn component<T: Component + DowncastType>( &self, component: DataComponentType<T>, ) -> Option<&T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ItemInstanceView for ItemStackTemplate

Source§

fn item_ref(&self) -> ItemRef

Source§

fn item_count(&self) -> i32

Source§

fn effective_value_raw(&self, key: &Identifier) -> Option<&ComponentData>

Implementors§