pub struct NetSplitter(pub Address);Expand description
The net_splitter component (4 methods).
Provided by OpenComputers’ NetSplitter, NetSplitterTile.
Tuple Fields§
§0: AddressImplementations§
Source§impl NetSplitter
impl NetSplitter
Sourcepub fn close(&self, side: impl Into<Number>) -> Result<bool>
pub fn close(&self, side: impl Into<Number>) -> Result<bool>
Close the side, returns true if it changed to close.
Lua: net_splitter.close(side: number):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn close_async(&self, side: impl Into<Number>) -> Result<bool>
pub async fn close_async(&self, side: impl Into<Number>) -> Result<bool>
Self::close without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_sides(&self) -> Result<Value>
pub fn get_sides(&self) -> Result<Value>
Returns current open/close state of all sides in an array, indexed by direction.
Lua: net_splitter.getSides():table
Direct call (runs immediately, drawing on the per-tick budget).
Sourcepub async fn get_sides_async(&self) -> Result<Value>
pub async fn get_sides_async(&self) -> Result<Value>
Self::get_sides without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn open(&self, side: impl Into<Number>) -> Result<bool>
pub fn open(&self, side: impl Into<Number>) -> Result<bool>
Open the side, returns true if it changed to open.
Lua: net_splitter.open(side: number):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn open_async(&self, side: impl Into<Number>) -> Result<bool>
pub async fn open_async(&self, side: impl Into<Number>) -> Result<bool>
Self::open without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn set_sides(&self, settings: impl Into<Value>) -> Result<Value>
pub fn set_sides(&self, settings: impl Into<Value>) -> Result<Value>
set open state (true/false) of all sides in an array; index by direction. Returns previous states
Lua: net_splitter.setSides(settings:table):table
Indirect call: waits for the next server tick.
Sourcepub async fn set_sides_async(&self, settings: impl Into<Value>) -> Result<Value>
pub async fn set_sides_async(&self, settings: impl Into<Value>) -> Result<Value>
Self::set_sides 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 NetSplitter
impl Clone for NetSplitter
Source§impl Component for NetSplitter
impl Component for NetSplitter
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.