pub struct InventoryBuilder<K, S: SlotType, U: Default> { /* private fields */ }Expand description
Builder for Inventory.
Implementations§
Source§impl<K: Clone, S: SlotType + Clone, U: Default + Clone> InventoryBuilder<K, S, U>
impl<K: Clone, S: SlotType + Clone, U: Default + Clone> InventoryBuilder<K, S, U>
Sourcepub fn content(&mut self, value: Vec<Option<ItemInstance<K, U>>>) -> &mut Self
pub fn content(&mut self, value: Vec<Option<ItemInstance<K, U>>>) -> &mut Self
The contents of the Inventory.
None values indicate empty but existing inventory slots.
Sourcepub fn slot_restriction(&mut self, value: Vec<Option<S>>) -> &mut Self
pub fn slot_restriction(&mut self, value: Vec<Option<S>>) -> &mut Self
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.
Sourcepub fn move_to_front(&mut self, value: MoveToFrontMode) -> &mut Self
pub fn move_to_front(&mut self, value: MoveToFrontMode) -> &mut Self
Configures how item deletion is handled.
Sourcepub fn sizing_mode(&mut self, value: InventorySizingMode) -> &mut Self
pub fn sizing_mode(&mut self, value: InventorySizingMode) -> &mut Self
Configures if the inventory resizes when item are inserted/removed or not.
Trait Implementations§
Auto Trait Implementations§
impl<K, S, U> Freeze for InventoryBuilder<K, S, U>
impl<K, S, U> RefUnwindSafe for InventoryBuilder<K, S, U>
impl<K, S, U> Send for InventoryBuilder<K, S, U>
impl<K, S, U> Sync for InventoryBuilder<K, S, U>
impl<K, S, U> Unpin for InventoryBuilder<K, S, U>
impl<K, S, U> UnwindSafe for InventoryBuilder<K, S, U>
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