pub struct InventoryOperations { /* private fields */ }Expand description
The device for the inventory operations module
Implementations§
Source§impl InventoryOperations
impl InventoryOperations
Sourcepub fn drop(
&self,
count: u32,
side: Option<RobotSide>,
) -> Result<u32, HlapiClientError>
pub fn drop( &self, count: u32, side: Option<RobotSide>, ) -> Result<u32, HlapiClientError>
Tries to drop the given number of items to the specified side, defaulting to RobotSide::Front.
Items are dropped into the world if there is no inventory to that side. Returns the actual number of
items dropped.
Sourcepub fn drop_into(
&self,
slot: u32,
count: u32,
side: Option<RobotSide>,
) -> Result<u32, HlapiClientError>
pub fn drop_into( &self, slot: u32, count: u32, side: Option<RobotSide>, ) -> Result<u32, HlapiClientError>
Tries to drop the given number of items into the given slot of the inventory to the specified side,
defaulting to RobotSide::Front. Returns the actual number of items dropped.
Sourcepub fn get_item_slot_count(
&self,
side: Option<RobotSide>,
) -> Result<Option<NonZeroU32>, HlapiClientError>
pub fn get_item_slot_count( &self, side: Option<RobotSide>, ) -> Result<Option<NonZeroU32>, HlapiClientError>
Gets the number of slots in the inventory to the specified side, defaulting to RobotSide::Front.
Returns None if there is no inventory to that side.
Sourcepub fn get_item_slot_limit(
&self,
slot: u32,
side: Option<RobotSide>,
) -> Result<u32, HlapiClientError>
pub fn get_item_slot_limit( &self, slot: u32, side: Option<RobotSide>, ) -> Result<u32, HlapiClientError>
Gets the number of items the given slot in the inventory to the specified side, defaulting to
RobotSide::Front, can hold.
Sourcepub fn get_item_stack_in_slot(
&self,
slot: u32,
side: Option<RobotSide>,
) -> Result<Option<ItemStack>, HlapiClientError>
pub fn get_item_stack_in_slot( &self, slot: u32, side: Option<RobotSide>, ) -> Result<Option<ItemStack>, HlapiClientError>
Gets the contents of the given slot in the inventory to the specified side, defaulting to
RobotSide::Front. Returns None if the slot is empty.
Sourcepub fn move_internal(
&self,
from: u32,
into: u32,
max_count: u32,
) -> Result<u32, HlapiClientError>
pub fn move_internal( &self, from: u32, into: u32, max_count: u32, ) -> Result<u32, HlapiClientError>
Moves up to the given number of items from one internal inventory slot to another, returning the actual count of items moved.
Sourcepub fn move_from(
&self,
into: u32,
max_count: u32,
) -> Result<u32, HlapiClientError>
pub fn move_from( &self, into: u32, max_count: u32, ) -> Result<u32, HlapiClientError>
Moves up to the given number of items from the container in the selected slot to the given internal slot, returning the actual count of items moved.
Sourcepub fn move_into(
&self,
from: u32,
max_count: u32,
) -> Result<u32, HlapiClientError>
pub fn move_into( &self, from: u32, max_count: u32, ) -> Result<u32, HlapiClientError>
Moves up to the given number of items from the given internal slot to the container in the selected slot, returning the actual count of items moved.
Sourcepub fn take(
&self,
max_count: u32,
side: Option<RobotSide>,
) -> Result<u32, HlapiClientError>
pub fn take( &self, max_count: u32, side: Option<RobotSide>, ) -> Result<u32, HlapiClientError>
Tries to take up to the given number of items from the specified side, defaulting to
RobotSide::Front. Items are taken from the world if there is no inventory to that side.
Returns the actual count of items taken.
Sourcepub fn take_from(
&self,
slot: u32,
max_count: u32,
side: Option<RobotSide>,
) -> Result<u32, HlapiClientError>
pub fn take_from( &self, slot: u32, max_count: u32, side: Option<RobotSide>, ) -> Result<u32, HlapiClientError>
Tries to take up to the given number of items from the given slot of the inventory to the
specified side, defaulting to RobotSide::Front. Returns the actual count of items taken.
Trait Implementations§
Source§impl Clone for InventoryOperations
impl Clone for InventoryOperations
Source§impl Debug for InventoryOperations
impl Debug for InventoryOperations
Source§impl DeviceBase for InventoryOperations
impl DeviceBase for InventoryOperations
Source§type Event = !
type Event = !
Infallible if parse_event is not implemented.