pub struct Inv<T> { /* private fields */ }Implementations§
Source§impl<T> Inv<T>
impl<T> Inv<T>
pub fn new(slot_amount: usize) -> Self
Sourcepub fn auto_stack(
&mut self,
to_place: ItemStack<T>,
) -> Result<(), InvOverflow<T>>
pub fn auto_stack( &mut self, to_place: ItemStack<T>, ) -> Result<(), InvOverflow<T>>
Add items to the Inventory Already used slots will be filled before empty slots will
Sourcepub fn stack_at(
&mut self,
index: usize,
to_place: ItemStack<T>,
) -> Result<Result<(), StackErr<T>>, InvAccessErr>
pub fn stack_at( &mut self, index: usize, to_place: ItemStack<T>, ) -> Result<Result<(), StackErr<T>>, InvAccessErr>
Add items to a specific Slot
Sourcepub fn take_stack(&mut self, index: usize) -> Result<ItemStack<T>, InvAccessErr>
pub fn take_stack(&mut self, index: usize) -> Result<ItemStack<T>, InvAccessErr>
Take the entire ItemStack sitting in a Slot at a given position. This means, that the ItemStack will be taken out of the slot, leaving it empty
Sourcepub fn get_slot(&self, index: usize) -> Result<&Slot<T>, InvAccessErr>
pub fn get_slot(&self, index: usize) -> Result<&Slot<T>, InvAccessErr>
Return a Slot with at a given position
Sourcepub fn get_slot_mut(
&mut self,
index: usize,
) -> Result<&mut Slot<T>, InvAccessErr>
pub fn get_slot_mut( &mut self, index: usize, ) -> Result<&mut Slot<T>, InvAccessErr>
Return a Slot with at a given position mutably
Sourcepub fn find_slot(&self, item: T) -> Result<&Slot<T>, InvAccessErr>
pub fn find_slot(&self, item: T) -> Result<&Slot<T>, InvAccessErr>
Return a Slot with a given item
Sourcepub fn find_slot_mut(&mut self, item: T) -> Result<&mut Slot<T>, InvAccessErr>
pub fn find_slot_mut(&mut self, item: T) -> Result<&mut Slot<T>, InvAccessErr>
Return a Slot with a given item mutably
Trait Implementations§
Source§impl<T> IntoIterator for Inv<T>
impl<T> IntoIterator for Inv<T>
Source§impl<T: Ord> Ord for Inv<T>
impl<T: Ord> Ord for Inv<T>
Source§impl<T: PartialOrd> PartialOrd for Inv<T>
impl<T: PartialOrd> PartialOrd for Inv<T>
impl<T: Eq> Eq for Inv<T>
impl<T> StructuralPartialEq for Inv<T>
Auto Trait Implementations§
impl<T> Freeze for Inv<T>
impl<T> RefUnwindSafe for Inv<T>where
T: RefUnwindSafe,
impl<T> Send for Inv<T>where
T: Send,
impl<T> Sync for Inv<T>where
T: Sync,
impl<T> Unpin for Inv<T>where
T: Unpin,
impl<T> UnwindSafe for Inv<T>where
T: UnwindSafe,
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