pub struct InventoryOperationsModule(pub String);Expand description
A device capable of manipulating inventories in the world
Tuple Fields§
§0: StringTrait Implementations§
Source§impl InventoryOperationsInterface for InventoryOperationsModule
impl InventoryOperationsInterface for InventoryOperationsModule
Source§fn move_stack(
&self,
bus: &mut DeviceBus,
from: i32,
into: i32,
count: i32,
) -> Result<Option<()>>
fn move_stack( &self, bus: &mut DeviceBus, from: i32, into: i32, count: i32, ) -> Result<Option<()>>
OC2 Docs:
tries to move the specified number of items from one robot inventory slot to another.
Source§fn drop(&self, bus: &mut DeviceBus, count: i32, side: &str) -> Result<i32>
fn drop(&self, bus: &mut DeviceBus, count: i32, side: &str) -> Result<i32>
OC2 Docs:
tries to drop items from the specified slot in the specified direction. It will drop items either into an inventory, or the world if no inventory is present.
Returns the number of items dropped.
Source§fn drop_into(
&self,
bus: &mut DeviceBus,
into: i32,
count: i32,
side: &str,
) -> Result<i32>
fn drop_into( &self, bus: &mut DeviceBus, into: i32, count: i32, side: &str, ) -> Result<i32>
OC2 Docs:
tries to drop items from the specified slot into the specified slot of an inventory in the specified direction. It will only drop items into an inventory.
Returns the number of items dropped.
Source§fn take(&self, bus: &mut DeviceBus, count: i32, side: &str) -> Result<i32>
fn take(&self, bus: &mut DeviceBus, count: i32, side: &str) -> Result<i32>
OC2 Docs:
tries to take the specified number of items from the specified direction. It will take items from either an inventory, or the world if no inventory is present.
Returns the number of items taken.
Source§fn take_from(
&self,
bus: &mut DeviceBus,
from: i32,
count: i32,
side: &str,
) -> Result<i32>
fn take_from( &self, bus: &mut DeviceBus, from: i32, count: i32, side: &str, ) -> Result<i32>
OC2 Docs:
tries to take the specified number of items from the specified slot from an inventory in the specified direction. It will only take items from an inventory.
Returns the number of items taken.
Auto Trait Implementations§
impl Freeze for InventoryOperationsModule
impl RefUnwindSafe for InventoryOperationsModule
impl Send for InventoryOperationsModule
impl Sync for InventoryOperationsModule
impl Unpin for InventoryOperationsModule
impl UnsafeUnpin for InventoryOperationsModule
impl UnwindSafe for InventoryOperationsModule
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