Struct inv_sys::Inv[][src]

pub struct Inv<T> { /* fields omitted */ }

Implementations

impl<T> Inv<T> where
    T: Stacksize + Eq + Clone
[src]

pub fn new(maxslots: usize) -> Self[src]

pub fn place_at(&mut self, item: (T, usize), slot: usize) -> Option<(T, usize)>[src]

Returns an Optional Item for the amount of an item, that could not be placed

pub fn stack(&mut self, item: (T, usize)) -> Option<(T, usize)>[src]

Tries to stack the item, returns remaining item.assert_eq! If no item is found, that it can be stacked on, the place_at_first_free method is used

pub fn can_be_filled_with(&self, item: (T, usize)) -> bool[src]

If there still can be filled some slot with a minimum amount of 1, this should return true

pub fn place_at_first_free(&mut self, item: (T, usize)) -> Option<(T, usize)>[src]

Try to place the item at the first free spot, returns the remaining item

pub fn get_slot(&self, slot: usize) -> Option<&(T, usize)>[src]

Get item of a specific slot position

pub fn get_selected_slot(&self) -> Option<&(T, usize)>[src]

Get item of the selected slot position

pub fn set_selected_slot(&mut self, slot: usize) -> bool[src]

Set the selected slot

pub fn decrease_selected_slot(&mut self) -> bool[src]

Decreases the amount of the item in the selected slot by 1

Auto Trait Implementations

impl<T> RefUnwindSafe for Inv<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Inv<T> where
    T: Send
[src]

impl<T> Sync for Inv<T> where
    T: Sync
[src]

impl<T> Unpin for Inv<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Inv<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.