[][src]Struct inv_manager::Inventory

pub struct Inventory {
    pub item_types: Vec<ItemType>,
    pub item_instances: Vec<ItemInstance>,
}

Fields

item_types: Vec<ItemType>item_instances: Vec<ItemInstance>

Implementations

impl Inventory[src]

pub fn add_item_type(&mut self, item_type: ItemType) -> u32[src]

pub fn add_item_instance(
    &mut self,
    item_instance: ItemInstance
) -> Result<u32, InventoryError>
[src]

pub fn use_instance<'a>(&mut self, type_id: u32, quantity: Option<f32>)[src]

pub fn trash<'a>(&mut self, instance_id: u32)[src]

pub fn delete_item_type(&mut self, id: u32)[src]

pub fn delete_item_instance(&mut self, id: u32) -> Result<(), InventoryError>[src]

pub fn get_instances_for_type(
    &self,
    id: u32
) -> Result<Vec<&ItemInstance>, InventoryError>
[src]

pub fn get_types_for_name(&self, name: &String) -> Vec<&ItemType>[src]

pub fn quantity_for_type(&self, type_id: u32) -> f32[src]

Trait Implementations

impl Clone for Inventory[src]

impl Debug for Inventory[src]

impl Default for Inventory[src]

impl<'de> Deserialize<'de> for Inventory[src]

impl Serialize for Inventory[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.