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: AddressImplementations§
Source§impl Redstone
impl Redstone
Sourcepub fn get_bundled_input(
&self,
side: Option<Number>,
color: Option<Number>,
) -> Result<Value>
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).
Sourcepub async fn get_bundled_input_async(
&self,
side: Option<Number>,
color: Option<Number>,
) -> Result<Value>
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.
Sourcepub fn get_bundled_output(
&self,
side: Option<Number>,
color: Option<Number>,
) -> Result<Value>
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).
Sourcepub async fn get_bundled_output_async(
&self,
side: Option<Number>,
color: Option<Number>,
) -> Result<Value>
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.
Sourcepub fn get_comparator_input(&self, side: impl Into<Number>) -> Result<Number>
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).
Sourcepub async fn get_comparator_input_async(
&self,
side: impl Into<Number>,
) -> Result<Number>
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.
Sourcepub fn get_input(&self, side: Option<Number>) -> Result<Value>
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).
Sourcepub async fn get_input_async(&self, side: Option<Number>) -> Result<Value>
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.
Sourcepub fn get_output(&self, side: Option<Number>) -> Result<Value>
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).
Sourcepub async fn get_output_async(&self, side: Option<Number>) -> Result<Value>
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.
Sourcepub fn get_wake_threshold(&self) -> Result<Number>
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).
Sourcepub async fn get_wake_threshold_async(&self) -> Result<Number>
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.
Sourcepub fn get_wireless_frequency(&self) -> Result<Number>
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).
Sourcepub async fn get_wireless_frequency_async(&self) -> Result<Number>
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.
Sourcepub fn get_wireless_input(&self) -> Result<Number>
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.
Sourcepub async fn get_wireless_input_async(&self) -> Result<Number>
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.
Sourcepub fn get_wireless_output(&self) -> Result<bool>
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).
Sourcepub async fn get_wireless_output_async(&self) -> Result<bool>
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.
Sourcepub fn get_wireless_providers(&self) -> Result<Value>
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).
Sourcepub async fn get_wireless_providers_async(&self) -> Result<Value>
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.
Sourcepub fn set_bundled_output(
&self,
side: Option<Number>,
color: Option<Number>,
value: Option<Value>,
) -> Result<Value>
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.
Sourcepub async fn set_bundled_output_async(
&self,
side: Option<Number>,
color: Option<Number>,
value: Option<Value>,
) -> Result<Value>
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.
Sourcepub fn set_output(
&self,
side: Option<Number>,
value: Option<Value>,
) -> Result<Value>
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.
Sourcepub async fn set_output_async(
&self,
side: Option<Number>,
value: Option<Value>,
) -> Result<Value>
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.
Sourcepub fn set_wake_threshold(&self, threshold: impl Into<Number>) -> Result<Number>
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.
Sourcepub async fn set_wake_threshold_async(
&self,
threshold: impl Into<Number>,
) -> Result<Number>
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.
Sourcepub fn set_wireless_frequency(
&self,
frequency: impl Into<Number>,
) -> Result<Number>
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.
Sourcepub async fn set_wireless_frequency_async(
&self,
frequency: impl Into<Number>,
) -> Result<Number>
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.
Sourcepub fn set_wireless_output(&self, value: bool) -> Result<bool>
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.
Sourcepub async fn set_wireless_output_async(&self, value: bool) -> Result<bool>
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.
Sourcepub fn set_wireless_providers(
&self,
providers: impl Into<Value>,
) -> Result<Value>
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.
Sourcepub async fn set_wireless_providers_async(
&self,
providers: impl Into<Value>,
) -> Result<Value>
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 Component for Redstone
impl Component for Redstone
Source§fn from_address(address: Address) -> Self
fn from_address(address: Address) -> Self
fn address(&self) -> &Address
Source§fn at(address: impl Into<Address>) -> Option<Self>
fn at(address: impl Into<Address>) -> Option<Self>
address, if it is of this type.Source§fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
fn invoke(&self, method: &str, args: Vec<Value>) -> Result<Vec<Value>>
Source§fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
fn invoke_async(&self, method: &str, args: Vec<Value>) -> Call ⓘ
Component::invoke without blocking; see invoke_async.