Skip to main content

InventoryOperationsModule

Struct InventoryOperationsModule 

Source
pub struct InventoryOperationsModule(pub String);
Expand description

A device capable of manipulating inventories in the world

Tuple Fields§

§0: String

Trait Implementations§

Source§

impl IdentifiedDevice for InventoryOperationsModule

Source§

const IDENTITY: &'static str = "inventory_operations"

Source§

impl InventoryOperationsInterface for InventoryOperationsModule

Source§

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>

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>

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>

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>

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.
Source§

impl RPCDevice for InventoryOperationsModule

Source§

fn id(&self) -> &str

Returns uuid of this device.
Source§

fn from_id(id: String) -> Self

Create a device wrapper from an id.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.