Skip to main content

Transposer

Struct Transposer 

Source
pub struct Transposer(pub Address);
Expand description

The transposer component (25 methods).

Provided by OpenComputers’ Transposer$Block, Transposer$Common, Transposer$Upgrade, TransposerBase.

Tuple Fields§

§0: Address

Implementations§

Source§

impl Transposer

Source

pub fn are_stacks_equivalent( &self, side: impl Into<Number>, slot_a: impl Into<Number>, slot_b: impl Into<Number>, ) -> Result<bool>

Get whether the items in the two specified slots of the inventory on the specified side of the device are equivalent (have shared item tags).

Lua: transposer.areStacksEquivalent(side:number, slotA:number, slotB:number):boolean Indirect call: waits for the next server tick.

Source

pub async fn are_stacks_equivalent_async( &self, side: impl Into<Number>, slot_a: impl Into<Number>, slot_b: impl Into<Number>, ) -> Result<bool>

Self::are_stacks_equivalent without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn compare_stack_to_database( &self, side: impl Into<Number>, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, check_nbt: Option<bool>, ) -> Result<bool>

Compare an item in the specified slot in the inventory on the specified side with one in the database with the specified address.

Lua: transposer.compareStackToDatabase(side:number, slot:number, dbAddress:string, dbSlot:number[, checkNBT:boolean=false]):boolean Indirect call: waits for the next server tick. check_nbt defaults to false.

Source

pub async fn compare_stack_to_database_async( &self, side: impl Into<Number>, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, check_nbt: Option<bool>, ) -> Result<bool>

Self::compare_stack_to_database without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn compare_stacks( &self, side: impl Into<Number>, slot_a: impl Into<Number>, slot_b: impl Into<Number>, check_nbt: Option<bool>, ) -> Result<bool>

Get whether the items in the two specified slots of the inventory on the specified side of the device are of the same type.

Lua: transposer.compareStacks(side:number, slotA:number, slotB:number[, checkNBT:boolean=false]):boolean Indirect call: waits for the next server tick. check_nbt defaults to false.

Source

pub async fn compare_stacks_async( &self, side: impl Into<Number>, slot_a: impl Into<Number>, slot_b: impl Into<Number>, check_nbt: Option<bool>, ) -> Result<bool>

Self::compare_stacks without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_all_stacks(&self, side: impl Into<Number>) -> Result<Handle>

Get a description of all stacks in the inventory on the specified side of the device.

Lua: transposer.getAllStacks(side:number):userdata Indirect call: waits for the next server tick.

Source

pub async fn get_all_stacks_async( &self, side: impl Into<Number>, ) -> Result<Handle>

Self::get_all_stacks without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_container_capacity_in_slot( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>

Get the capacity of the fluid container in the specified slot.

Lua: transposer.getContainerCapacityInSlot(side:number, slot:number):number Indirect call: waits for the next server tick.

Source

pub async fn get_container_capacity_in_slot_async( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>

Self::get_container_capacity_in_slot without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_container_level_in_slot( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>

Get the level of the fluid container in the specified slot.

Lua: transposer.getContainerLevelInSlot(side:number, slot:number):number Indirect call: waits for the next server tick.

Source

pub async fn get_container_level_in_slot_async( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>

Self::get_container_level_in_slot without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_fluid_in_container_in_slot( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Value>

Get a description of the fluid in the container in the specified slot.

Lua: transposer.getFluidInContainerInSlot(side:number, slot:number):table Indirect call: waits for the next server tick.

Source

pub async fn get_fluid_in_container_in_slot_async( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Value>

Self::get_fluid_in_container_in_slot without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_fluid_in_tank( &self, side: impl Into<Number>, tank: Option<Number>, ) -> Result<Value>

Get a description of the fluid in the tank on the specified side.

Lua: transposer.getFluidInTank(side:number [, tank:number]):table Indirect call: waits for the next server tick.

Source

pub async fn get_fluid_in_tank_async( &self, side: impl Into<Number>, tank: Option<Number>, ) -> Result<Value>

Self::get_fluid_in_tank without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_fluid_transfer_rate(&self) -> Result<Number>

Returns the fluid transfer rate in liters per second.

Lua: transposer.getFluidTransferRate():number Indirect call: waits for the next server tick.

Source

pub async fn get_fluid_transfer_rate_async(&self) -> Result<Number>

Self::get_fluid_transfer_rate without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_inventory_name(&self, side: impl Into<Number>) -> Result<OcString>

Get the name of the inventory on the specified side of the device.

Lua: transposer.getInventoryName(side:number):string Indirect call: waits for the next server tick.

Source

pub async fn get_inventory_name_async( &self, side: impl Into<Number>, ) -> Result<OcString>

Self::get_inventory_name without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_inventory_size(&self, side: impl Into<Number>) -> Result<Number>

Get the number of slots in the inventory on the specified side of the device.

Lua: transposer.getInventorySize(side:number):number Indirect call: waits for the next server tick.

Source

pub async fn get_inventory_size_async( &self, side: impl Into<Number>, ) -> Result<Number>

Self::get_inventory_size without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_slot_max_stack_size( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>

Get the maximum number of items in the specified slot of the inventory on the specified side of the device.

Lua: transposer.getSlotMaxStackSize(side:number, slot:number):number Indirect call: waits for the next server tick.

Source

pub async fn get_slot_max_stack_size_async( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>

Self::get_slot_max_stack_size without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_slot_stack_size( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>

Get number of items in the specified slot of the inventory on the specified side of the device.

Lua: transposer.getSlotStackSize(side:number, slot:number):number Indirect call: waits for the next server tick.

Source

pub async fn get_slot_stack_size_async( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Number>

Self::get_slot_stack_size without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_stack_in_slot( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Value>

Get a description of the stack in the inventory on the specified side of the device.

Lua: transposer.getStackInSlot(side:number, slot:number):table Indirect call: waits for the next server tick.

Source

pub async fn get_stack_in_slot_async( &self, side: impl Into<Number>, slot: impl Into<Number>, ) -> Result<Value>

Self::get_stack_in_slot without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_tank_capacity( &self, side: impl Into<Number>, tank: Option<Number>, ) -> Result<Number>

Get the capacity of the tank on the specified side.

Lua: transposer.getTankCapacity(side:number [, tank:number]):number Indirect call: waits for the next server tick.

Source

pub async fn get_tank_capacity_async( &self, side: impl Into<Number>, tank: Option<Number>, ) -> Result<Number>

Self::get_tank_capacity without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_tank_count(&self, side: impl Into<Number>) -> Result<Number>

Get the number of tanks available on the specified side.

Lua: transposer.getTankCount(side:number):number Indirect call: waits for the next server tick.

Source

pub async fn get_tank_count_async( &self, side: impl Into<Number>, ) -> Result<Number>

Self::get_tank_count without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn get_tank_level( &self, side: impl Into<Number>, tank: Option<Number>, ) -> Result<Number>

Get the amount of fluid in the tank on the specified side.

Lua: transposer.getTankLevel(side:number [, tank:number]):number Indirect call: waits for the next server tick.

Source

pub async fn get_tank_level_async( &self, side: impl Into<Number>, tank: Option<Number>, ) -> Result<Number>

Self::get_tank_level without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn set_stack_display_name( &self, side: impl Into<Number>, slot: impl Into<Number>, label: impl AsRef<[u8]>, ) -> Result<bool>

Change the display name of the stack.

Lua: transposer.setStackDisplayName(side:number, slot:number, label:string):boolean Indirect call: waits for the next server tick.

Source

pub async fn set_stack_display_name_async( &self, side: impl Into<Number>, slot: impl Into<Number>, label: impl AsRef<[u8]>, ) -> Result<bool>

Self::set_stack_display_name without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn store( &self, side: impl Into<Number>, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, ) -> Result<bool>

Store an item stack description in the specified slot of the database with the specified address.

Lua: transposer.store(side:number, slot:number, dbAddress:string, dbSlot:number):boolean Indirect call: waits for the next server tick.

Source

pub async fn store_async( &self, side: impl Into<Number>, slot: impl Into<Number>, db_address: impl AsRef<[u8]>, db_slot: impl Into<Number>, ) -> Result<bool>

Self::store without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn swap( &self, source_side: impl Into<Number>, sink_side: impl Into<Number>, source_slot: impl Into<Number>, sink_slot: impl Into<Number>, safe: Option<bool>, ) -> Result<bool>

Swap two inventory slots if and only if both directions succeed.

Lua: transposer.swap(sourceSide:number, sinkSide:number, sourceSlot:number, sinkSlot:number[, safe:boolean]):boolean Indirect call: waits for the next server tick.

Source

pub async fn swap_async( &self, source_side: impl Into<Number>, sink_side: impl Into<Number>, source_slot: impl Into<Number>, sink_slot: impl Into<Number>, safe: Option<bool>, ) -> Result<bool>

Self::swap without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn transfer_fluid( &self, source_side: impl Into<Number>, sink_side: impl Into<Number>, count: Option<Number>, source_tank: Option<Number>, ) -> Result<(bool, Number)>

Transfer some fluid between two tanks. Returns operation result and filled amount

Lua: transposer.transferFluid(sourceSide:number, sinkSide:number[, count:number [, sourceTank:number]]):boolean, number Indirect call: waits for the next server tick.

Source

pub async fn transfer_fluid_async( &self, source_side: impl Into<Number>, sink_side: impl Into<Number>, count: Option<Number>, source_tank: Option<Number>, ) -> Result<(bool, Number)>

Self::transfer_fluid without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn transfer_fluid_between_containers( &self, source_side: impl Into<Number>, source_slot: impl Into<Number>, sink_side: impl Into<Number>, sink_slot: impl Into<Number>, count: Option<Number>, arg5: &[Value], ) -> Result<(bool, Number)>

Transfer some fluid between containers.

Lua: transposer.transferFluidBetweenContainers(sourceSide:number, sourceSlot:number, sinkSide:number, sinkSlot:number[, count:number, ...]):boolean, number Indirect call: waits for the next server tick.

Source

pub async fn transfer_fluid_between_containers_async( &self, source_side: impl Into<Number>, source_slot: impl Into<Number>, sink_side: impl Into<Number>, sink_slot: impl Into<Number>, count: Option<Number>, arg5: &[Value], ) -> Result<(bool, Number)>

Self::transfer_fluid_between_containers without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn transfer_fluid_from_container_to_tank( &self, inventory_side: impl Into<Number>, inventory_slot: impl Into<Number>, tank_side: impl Into<Number>, count: Option<Number>, output_side: Option<Number>, output_slot: Option<Number>, ) -> Result<(bool, Number)>

Transfer some fluid from the container to the tank.

Lua: transposer.transferFluidFromContainerToTank(inventorySide:number, inventorySlot:number, tankSide:number[, count:number[, outputSide:number[, outputSlot:number]]]):boolean, number Indirect call: waits for the next server tick.

Source

pub async fn transfer_fluid_from_container_to_tank_async( &self, inventory_side: impl Into<Number>, inventory_slot: impl Into<Number>, tank_side: impl Into<Number>, count: Option<Number>, output_side: Option<Number>, output_slot: Option<Number>, ) -> Result<(bool, Number)>

Self::transfer_fluid_from_container_to_tank without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn transfer_fluid_from_tank_to_container( &self, tank_side: impl Into<Number>, inventory_side: impl Into<Number>, inventory_slot: impl Into<Number>, count: Option<Number>, source_tank: Option<Number>, output_side: Option<Number>, output_slot: Option<Number>, ) -> Result<(bool, Number)>

Transfer some fluid from the tank to the container.

Lua: transposer.transferFluidFromTankToContainer(tankSide:number, inventorySide:number, inventorySlot:number[, count:number[, sourceTank:number[, outputSide:number[, outputSlot:number]]]]):boolean, number Indirect call: waits for the next server tick.

Source

pub async fn transfer_fluid_from_tank_to_container_async( &self, tank_side: impl Into<Number>, inventory_side: impl Into<Number>, inventory_slot: impl Into<Number>, count: Option<Number>, source_tank: Option<Number>, output_side: Option<Number>, output_slot: Option<Number>, ) -> Result<(bool, Number)>

Self::transfer_fluid_from_tank_to_container without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Source

pub fn transfer_item( &self, source_side: impl Into<Number>, sink_side: impl Into<Number>, count: Option<Number>, source_slot: Option<Number>, sink_slot: Option<Number>, ) -> Result<bool>

Transfer some items between two inventories.

Lua: transposer.transferItem(sourceSide:number, sinkSide:number[, count:number[, sourceSlot:number[, sinkSlot:number]]]):boolean Indirect call: waits for the next server tick.

Source

pub async fn transfer_item_async( &self, source_side: impl Into<Number>, sink_side: impl Into<Number>, count: Option<Number>, source_slot: Option<Number>, sink_slot: Option<Number>, ) -> Result<bool>

Self::transfer_item without blocking: the call is queued, and the program keeps running until the result comes back; see crate::task.

Trait Implementations§

Source§

impl Clone for Transposer

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Component for Transposer

Source§

const KIND: &'static str = "transposer"

The OpenComputers component type, such as "gpu".
Source§

fn from_address(address: Address) -> Self

Wraps an address without checking what is there.
Source§

fn address(&self) -> &Address

Source§

fn first() -> Option<Self>

The first component of this type, by address order.
Source§

fn all() -> Vec<Self>

Every component of this type, by address order.
Source§

fn at(address: impl Into<Address>) -> Option<Self>

The component at address, if it is of this type.
Source§

fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>

An untyped call, for methods the wrapper doesn’t know.
Source§

fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ

Component::invoke without blocking; see invoke_async.
Source§

impl Debug for Transposer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Transposer

Source§

impl Hash for Transposer

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Transposer

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Transposer

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.