pub enum ItemError<K, U>{
StackOverflow(ItemInstance<K, U>),
InventoryFull,
InventoryOverflow(Vec<ItemInstance<K, U>>),
ItemDestroyed(ItemInstance<K, U>),
StackConsumed(ItemInstance<K, U>),
SlotOccupied,
SlotRestricted,
LockedOriginSlot,
LockedRemoteSlot,
SlotEmpty,
NotEnoughQuantity,
}Expand description
The different errors that can happen when interacting with the Inventory.
Variants§
StackOverflow(ItemInstance<K, U>)
The stack doesn’t fit completely inside of the slot.
InventoryFull
The inventory is full and cannot be resized anymore.
InventoryOverflow(Vec<ItemInstance<K, U>>)
The inventory cannot fit the specified items inside of itself. It has no more empty slots, cannot be resized and no item can be stacked with others.
ItemDestroyed(ItemInstance<K, U>)
The item was used and the durability is now 0.
StackConsumed(ItemInstance<K, U>)
The stack size was decreased and is now 0.
SlotOccupied
The slot already has something inside of it.
SlotRestricted
The specified item cannot be inserted into this type of slot.
LockedOriginSlot
The origin slot is locked. The item cannot be moved or inserted.
LockedRemoteSlot
The remote slot is locked. The item cannot be moved or inserted.
SlotEmpty
The slot at the specified index is empty or non-existant.
NotEnoughQuantity
There is not enough of the specified item to satisfy the query.
Trait Implementations§
Auto Trait Implementations§
impl<K, U> Freeze for ItemError<K, U>
impl<K, U> RefUnwindSafe for ItemError<K, U>where
K: RefUnwindSafe,
U: RefUnwindSafe,
impl<K, U> Send for ItemError<K, U>
impl<K, U> Sync for ItemError<K, U>
impl<K, U> Unpin for ItemError<K, U>
impl<K, U> UnwindSafe for ItemError<K, U>where
K: UnwindSafe,
U: 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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more