pub struct InventoryBuilder<K, S, U>{ /* private fields */ }Expand description
Builder for Inventory.
Implementations§
Source§impl<K, S, U> InventoryBuilder<K, S, U>
impl<K, S, U> InventoryBuilder<K, S, U>
Sourcepub fn content(
&mut self,
value: Vec<Option<ItemInstance<K, U>>>,
) -> &mut InventoryBuilder<K, S, U>
pub fn content( &mut self, value: Vec<Option<ItemInstance<K, U>>>, ) -> &mut InventoryBuilder<K, S, U>
The contents of the Inventory.
None values indicate empty but existing inventory slots.
Sourcepub fn slot_restriction(
&mut self,
value: Vec<Option<S>>,
) -> &mut InventoryBuilder<K, S, U>
pub fn slot_restriction( &mut self, value: Vec<Option<S>>, ) -> &mut InventoryBuilder<K, S, U>
Restricts what kind of item can go in different slots.
This is not compatible with InventorySizingMode::Dynamic.
Maps to the inventory content using the index. None values indicate that there are no restrictions for that slot.
Sourcepub fn move_to_front(
&mut self,
value: MoveToFrontMode,
) -> &mut InventoryBuilder<K, S, U>
pub fn move_to_front( &mut self, value: MoveToFrontMode, ) -> &mut InventoryBuilder<K, S, U>
Configures how item deletion is handled.
Sourcepub fn sizing_mode(
&mut self,
value: InventorySizingMode,
) -> &mut InventoryBuilder<K, S, U>
pub fn sizing_mode( &mut self, value: InventorySizingMode, ) -> &mut InventoryBuilder<K, S, U>
Configures if the inventory resizes when item are inserted/removed or not.
Trait Implementations§
Source§impl<K, S, U> Clone for InventoryBuilder<K, S, U>
impl<K, S, U> Clone for InventoryBuilder<K, S, U>
Source§fn clone(&self) -> InventoryBuilder<K, S, U>
fn clone(&self) -> InventoryBuilder<K, S, U>
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 moreAuto Trait Implementations§
impl<K, S, U> Freeze for InventoryBuilder<K, S, U>
impl<K, S, U> RefUnwindSafe for InventoryBuilder<K, S, U>
impl<K, S, U> Send for InventoryBuilder<K, S, U>
impl<K, S, U> Sync for InventoryBuilder<K, S, U>
impl<K, S, U> Unpin for InventoryBuilder<K, S, U>
impl<K, S, U> UnwindSafe for InventoryBuilder<K, S, U>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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>
Converts
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>
Converts
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