pub struct Slot<T> { /* private fields */ }Implementations§
Source§impl<T> Slot<T>
impl<T> Slot<T>
Sourcepub fn stack(&mut self, to_place: ItemStack<T>) -> Result<(), StackErr<T>>
pub fn stack(&mut self, to_place: ItemStack<T>) -> Result<(), StackErr<T>>
Tops this slot up with a given ItemStack
Sourcepub fn get_item(&self) -> Result<&T, InvAccessErr>
pub fn get_item(&self) -> Result<&T, InvAccessErr>
Returns the item in the Slot
Sourcepub fn get_amount(&self) -> Result<usize, InvAccessErr>
pub fn get_amount(&self) -> Result<usize, InvAccessErr>
Returns the amount of items in the Slot
Sourcepub fn decrease_amount(&mut self) -> Result<(), InvAccessErr>
pub fn decrease_amount(&mut self) -> Result<(), InvAccessErr>
Decreases amount by 1
Sourcepub fn decrease_amount_by(&mut self, amount: usize) -> Result<(), InvAccessErr>
pub fn decrease_amount_by(&mut self, amount: usize) -> Result<(), InvAccessErr>
Decreases amount by a given arbitrary number
Trait Implementations§
Source§impl<T: Ord> Ord for Slot<T>
impl<T: Ord> Ord for Slot<T>
Source§impl<T: PartialOrd> PartialOrd for Slot<T>
impl<T: PartialOrd> PartialOrd for Slot<T>
impl<T: Eq> Eq for Slot<T>
impl<T> StructuralPartialEq for Slot<T>
Auto Trait Implementations§
impl<T> Freeze for Slot<T>where
T: Freeze,
impl<T> RefUnwindSafe for Slot<T>where
T: RefUnwindSafe,
impl<T> Send for Slot<T>where
T: Send,
impl<T> Sync for Slot<T>where
T: Sync,
impl<T> Unpin for Slot<T>where
T: Unpin,
impl<T> UnwindSafe for Slot<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