pub struct Relay(pub Address);Expand description
The relay component (4 methods).
Provided by OpenComputers’ Relay.
Tuple Fields§
§0: AddressImplementations§
Source§impl Relay
impl Relay
Sourcepub fn get_strength(&self) -> Result<Number>
pub fn get_strength(&self) -> Result<Number>
Get the signal strength (range) used when relaying messages.
Lua: relay.getStrength():number
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn get_strength_async(&self) -> Result<Number>
pub async fn get_strength_async(&self) -> Result<Number>
Self::get_strength without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn is_repeater(&self) -> Result<bool>
pub fn is_repeater(&self) -> Result<bool>
Get whether the access point currently acts as a repeater (resend received wireless packets wirelessly).
Lua: relay.isRepeater():boolean
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn is_repeater_async(&self) -> Result<bool>
pub async fn is_repeater_async(&self) -> Result<bool>
Self::is_repeater without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_repeater(&self, enabled: bool) -> Result<bool>
pub fn set_repeater(&self, enabled: bool) -> Result<bool>
Set whether the access point should act as a repeater.
Lua: relay.setRepeater(enabled:boolean):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn set_repeater_async(&self, enabled: bool) -> Result<bool>
pub async fn set_repeater_async(&self, enabled: bool) -> Result<bool>
Self::set_repeater without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_strength(&self, strength: impl Into<Number>) -> Result<Number>
pub fn set_strength(&self, strength: impl Into<Number>) -> Result<Number>
Set the signal strength (range) used when relaying messages.
Lua: relay.setStrength(strength:number):number
Indirect call: waits for the next server tick.
Sourcepub async fn set_strength_async(
&self,
strength: impl Into<Number>,
) -> Result<Number>
pub async fn set_strength_async( &self, strength: impl Into<Number>, ) -> Result<Number>
Self::set_strength 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 Relay
impl Component for Relay
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.