Skip to main content

Redstone

Struct Redstone 

Source
pub struct Redstone(pub Address);
Expand description

The redstone component (16 methods).

Provided by OpenComputers’ Redstone$Bundled, Redstone$BundledWireless, Redstone$Vanilla, Redstone$VanillaWireless, Redstone$Wireless, RedstoneSignaller, RedstoneVanilla.

Tuple Fields§

§0: Address

Implementations§

Source§

impl Redstone

Source

pub fn get_bundled_input( &self, side: Option<Number>, color: Option<Number>, ) -> Result<Value>

Fewer params returns set of inputs

Lua: redstone.getBundledInput([side:number[, color:number]]):number or table Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn get_bundled_input_async( &self, side: Option<Number>, color: Option<Number>, ) -> Result<Value>

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

Source

pub fn get_bundled_output( &self, side: Option<Number>, color: Option<Number>, ) -> Result<Value>

Fewer params returns set of outputs

Lua: redstone.getBundledOutput([side:number[, color:number]]):number or table Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn get_bundled_output_async( &self, side: Option<Number>, color: Option<Number>, ) -> Result<Value>

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

Source

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

Get the comparator input on the specified side.

Lua: redstone.getComparatorInput(side:number):number Direct call (runs immediately, drawing on the per-tick budget).

Source

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

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

Source

pub fn get_input(&self, side: Option<Number>) -> Result<Value>

Get the redstone input (all sides, or optionally on the specified side)

Lua: redstone.getInput([side:number]):number or table Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn get_input_async(&self, side: Option<Number>) -> Result<Value>

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

Source

pub fn get_output(&self, side: Option<Number>) -> Result<Value>

Get the redstone output (all sides, or optionally on the specified side)

Lua: redstone.getOutput([side:number]):number or table Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn get_output_async(&self, side: Option<Number>) -> Result<Value>

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

Source

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

Get the current wake-up threshold.

Lua: redstone.getWakeThreshold():number Direct call (runs immediately, drawing on the per-tick budget).

Source

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

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

Source

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

Get the currently set wireless redstone frequency.

Lua: redstone.getWirelessFrequency():number Direct call (runs immediately, drawing on the per-tick budget).

Source

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

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

Source

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

Get the wireless redstone input.

Lua: redstone.getWirelessInput():number Indirect call: waits for the next server tick.

Source

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

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

Source

pub fn get_wireless_output(&self) -> Result<bool>

Get the wireless redstone output.

Lua: redstone.getWirelessOutput():boolean Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn get_wireless_output_async(&self) -> Result<bool>

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

Source

pub fn get_wireless_providers(&self) -> Result<Value>

Get the list of enabled wireless providers.

Lua: redstone.getWirelessProviders():table Direct call (runs immediately, drawing on the per-tick budget).

Source

pub async fn get_wireless_providers_async(&self) -> Result<Value>

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

Source

pub fn set_bundled_output( &self, side: Option<Number>, color: Option<Number>, value: Option<Value>, ) -> Result<Value>

Fewer params to assign set of outputs. Returns previous values

Lua: redstone.setBundledOutput([side:number[, color:number,]] value:number or table):number or table Indirect call: waits for the next server tick.

Source

pub async fn set_bundled_output_async( &self, side: Option<Number>, color: Option<Number>, value: Option<Value>, ) -> Result<Value>

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

Source

pub fn set_output( &self, side: Option<Number>, value: Option<Value>, ) -> Result<Value>

Set the redstone output (all sides, or optionally on the specified side). Returns previous values

Lua: redstone.setOutput([side:number, ]value:number or table):number or table Indirect call: waits for the next server tick.

Source

pub async fn set_output_async( &self, side: Option<Number>, value: Option<Value>, ) -> Result<Value>

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

Source

pub fn set_wake_threshold(&self, threshold: impl Into<Number>) -> Result<Number>

Set the wake-up threshold.

Lua: redstone.setWakeThreshold(threshold:number):number Indirect call: waits for the next server tick.

Source

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

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

Source

pub fn set_wireless_frequency( &self, frequency: impl Into<Number>, ) -> Result<Number>

Set the wireless redstone frequency to use.

Lua: redstone.setWirelessFrequency(frequency:number):number Indirect call: waits for the next server tick.

Source

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

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

Source

pub fn set_wireless_output(&self, value: bool) -> Result<bool>

Set the wireless redstone output.

Lua: redstone.setWirelessOutput(value:boolean):boolean Indirect call: waits for the next server tick.

Source

pub async fn set_wireless_output_async(&self, value: bool) -> Result<bool>

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

Source

pub fn set_wireless_providers( &self, providers: impl Into<Value>, ) -> Result<Value>

Set the enabled wireless providers.

Lua: redstone.setWirelessProviders(providers:table):table Indirect call: waits for the next server tick.

Source

pub async fn set_wireless_providers_async( &self, providers: impl Into<Value>, ) -> Result<Value>

Self::set_wireless_providers 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 Redstone

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 Redstone

Source§

const KIND: &'static str = "redstone"

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 Redstone

Source§

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

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

impl Eq for Redstone

Source§

impl Hash for Redstone

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 Redstone

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 Redstone

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.