[][src]Struct game_features::InventoryBuilder

pub struct InventoryBuilder<K, T, S: SlotType<T>, U: Default> { /* fields omitted */ }

Builder for Inventory.

Methods

impl<K: Clone, T: Clone, S: SlotType<T> + Clone, U: Default + Clone> InventoryBuilder<K, T, S, U>[src]

pub fn content(&mut self, value: Vec<Option<ItemInstance<K, U>>>) -> &mut Self[src]

The contents of the Inventory. None values indicate empty but existing inventory slots.

pub fn slot_restriction(&mut self, value: Vec<Option<S>>) -> &mut Self[src]

Restricts what kind of item can go in different slots. This is not compatible with InventorySizingMode::Dynamic.

Maps to the inventory content using the index. None values indicate that there are no restrictions for that slot.

pub fn move_to_front(&mut self, value: MoveToFrontMode) -> &mut Self[src]

Configures how item deletion is handled.

pub fn sizing_mode(&mut self, value: InventorySizingMode) -> &mut Self[src]

Configures if the inventory resizes when item are inserted/removed or not.

pub fn _phantom(&mut self, value: PhantomData<T>) -> &mut Self[src]

pub fn build(&self) -> Result<Inventory<K, T, S, U>, String>[src]

Builds a new Inventory.

Errors

If a required field has not been initialized.

Trait Implementations

impl<K: Default, T: Default, S: Default + SlotType<T>, U: Default + Default> Default for InventoryBuilder<K, T, S, U>[src]

impl<K: Clone, T: Clone, S: Clone + SlotType<T>, U: Clone + Default> Clone for InventoryBuilder<K, T, S, U>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<K, T, S, U> Send for InventoryBuilder<K, T, S, U> where
    K: Send,
    S: Send,
    T: Send,
    U: Send

impl<K, T, S, U> Sync for InventoryBuilder<K, T, S, U> where
    K: Sync,
    S: Sync,
    T: Sync,
    U: Sync

Blanket Implementations

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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