pub enum ExchangeError {
TooManyItems {
side: ExchangeSide,
count: usize,
},
ZeroAmount {
side: ExchangeSide,
item: u32,
},
MissingItem {
side: ExchangeSide,
item: u32,
requested: u64,
available: u32,
},
NoFreeSlot {
side: ExchangeSide,
item: u32,
},
StackCapacity {
side: ExchangeSide,
item: u32,
requested: u32,
available: u32,
},
LimitMismatch {
side: ExchangeSide,
item: u32,
expected: u32,
actual: u32,
},
}Expand description
First rejected part of an exchange. Neither inventory changes on an error.
Missing quantities are totals for an item across the side’s outgoing list.
Capacity and limit errors describe the recipient after all outgoing items
have been removed. requested in a capacity error is the incoming quantity;
available is remaining room in that stack.
Variants§
TooManyItems
The outgoing list exceeds MAX_EXCHANGE_ITEMS.
ZeroAmount
An outgoing entry requests zero items.
MissingItem
The original inventory cannot supply the total requested quantity.
NoFreeSlot
The recipient has no empty slot for this new item.
StackCapacity
The recipient’s existing stack cannot hold all incoming items.
LimitMismatch
Source and recipient stacks have different limits for the same item.
Trait Implementations§
Source§impl Clone for ExchangeError
impl Clone for ExchangeError
Source§fn clone(&self) -> ExchangeError
fn clone(&self) -> ExchangeError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExchangeError
impl Debug for ExchangeError
Source§impl PartialEq for ExchangeError
impl PartialEq for ExchangeError
impl Copy for ExchangeError
impl Eq for ExchangeError
impl StructuralPartialEq for ExchangeError
Auto Trait Implementations§
impl Freeze for ExchangeError
impl RefUnwindSafe for ExchangeError
impl Send for ExchangeError
impl Sync for ExchangeError
impl Unpin for ExchangeError
impl UnwindSafe for ExchangeError
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