pub struct Debug(pub Address);Expand description
The debug component (15 methods).
Provided by OpenComputers’ DebugCard, DebugCardBase.
Tuple Fields§
§0: AddressImplementations§
Source§impl Debug
impl Debug
Sourcepub fn change_buffer(&self, value: impl Into<Number>) -> Result<Number>
pub fn change_buffer(&self, value: impl Into<Number>) -> Result<Number>
Changes the component network’s energy buffer by the specified delta.
Lua: debug.changeBuffer(value:number):number
Indirect call: waits for the next server tick.
Sourcepub async fn change_buffer_async(
&self,
value: impl Into<Number>,
) -> Result<Number>
pub async fn change_buffer_async( &self, value: impl Into<Number>, ) -> Result<Number>
Self::change_buffer without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn connect_to_block(
&self,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
) -> Result<bool>
pub fn connect_to_block( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<bool>
Add a component block at the specified coordinates to the computer network.
Lua: debug.connectToBlock(x:number, y:number, z:number):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn connect_to_block_async(
&self,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
) -> Result<bool>
pub async fn connect_to_block_async( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<bool>
Self::connect_to_block without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_player(&self, name: impl AsRef<[u8]>) -> Result<Handle>
pub fn get_player(&self, name: impl AsRef<[u8]>) -> Result<Handle>
Get the entity of a player.
Lua: debug.getPlayer(name:string):userdata
Indirect call: waits for the next server tick.
Sourcepub async fn get_player_async(&self, name: impl AsRef<[u8]>) -> Result<Handle>
pub async fn get_player_async(&self, name: impl AsRef<[u8]>) -> Result<Handle>
Self::get_player without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_players(&self) -> Result<Value>
pub fn get_players(&self) -> Result<Value>
Get a list of currently logged-in players.
Lua: debug.getPlayers():table
Indirect call: waits for the next server tick.
Sourcepub async fn get_players_async(&self) -> Result<Value>
pub async fn get_players_async(&self) -> Result<Value>
Self::get_players without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_scoreboard(&self) -> Result<Handle>
pub fn get_scoreboard(&self) -> Result<Handle>
Get the scoreboard object for the world
Lua: debug.getScoreboard():userdata
Indirect call: waits for the next server tick.
Sourcepub async fn get_scoreboard_async(&self) -> Result<Handle>
pub async fn get_scoreboard_async(&self) -> Result<Handle>
Self::get_scoreboard without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_world(&self) -> Result<Handle>
pub fn get_world(&self) -> Result<Handle>
Get the world object of the container.
Lua: debug.getWorld():userdata
Indirect call: waits for the next server tick.
Sourcepub async fn get_world_async(&self) -> Result<Handle>
pub async fn get_world_async(&self) -> Result<Handle>
Self::get_world without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_x(&self) -> Result<Number>
pub fn get_x(&self) -> Result<Number>
Get the container’s X position in the world.
Lua: debug.getX():number
Indirect call: waits for the next server tick.
Sourcepub async fn get_x_async(&self) -> Result<Number>
pub async fn get_x_async(&self) -> Result<Number>
Self::get_x without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_y(&self) -> Result<Number>
pub fn get_y(&self) -> Result<Number>
Get the container’s Y position in the world.
Lua: debug.getY():number
Indirect call: waits for the next server tick.
Sourcepub async fn get_y_async(&self) -> Result<Number>
pub async fn get_y_async(&self) -> Result<Number>
Self::get_y without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_z(&self) -> Result<Number>
pub fn get_z(&self) -> Result<Number>
Get the container’s Z position in the world.
Lua: debug.getZ():number
Indirect call: waits for the next server tick.
Sourcepub async fn get_z_async(&self) -> Result<Number>
pub async fn get_z_async(&self) -> Result<Number>
Self::get_z without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn is_mod_loaded(&self, name: impl AsRef<[u8]>) -> Result<bool>
pub fn is_mod_loaded(&self, name: impl AsRef<[u8]>) -> Result<bool>
Get whether a mod or API is loaded.
Lua: debug.isModLoaded(name:string):boolean
Indirect call: waits for the next server tick.
Sourcepub async fn is_mod_loaded_async(&self, name: impl AsRef<[u8]>) -> Result<bool>
pub async fn is_mod_loaded_async(&self, name: impl AsRef<[u8]>) -> Result<bool>
Self::is_mod_loaded without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn run_command(&self, command: impl AsRef<[u8]>) -> Result<Number>
pub fn run_command(&self, command: impl AsRef<[u8]>) -> Result<Number>
Runs an arbitrary command using a fake player.
Lua: debug.runCommand(command:string):number
Indirect call: waits for the next server tick.
Sourcepub async fn run_command_async(
&self,
command: impl AsRef<[u8]>,
) -> Result<Number>
pub async fn run_command_async( &self, command: impl AsRef<[u8]>, ) -> Result<Number>
Self::run_command without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn scan_contents_at(
&self,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
) -> Result<(bool, OcString, Value)>
pub fn scan_contents_at( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<(bool, OcString, Value)>
returns contents at the location in the host world
Lua: debug.scanContentsAt(x: number, y: number, z: number):boolean, string, table
Indirect call: waits for the next server tick.
Sourcepub async fn scan_contents_at_async(
&self,
x: impl Into<Number>,
y: impl Into<Number>,
z: impl Into<Number>,
) -> Result<(bool, OcString, Value)>
pub async fn scan_contents_at_async( &self, x: impl Into<Number>, y: impl Into<Number>, z: impl Into<Number>, ) -> Result<(bool, OcString, Value)>
Self::scan_contents_at without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn send_to_clipboard(
&self,
player: impl AsRef<[u8]>,
text: impl AsRef<[u8]>,
) -> Result<()>
pub fn send_to_clipboard( &self, player: impl AsRef<[u8]>, text: impl AsRef<[u8]>, ) -> Result<()>
Sends text to the specified player’s clipboard if possible.
Lua: debug.sendToClipboard(player:string, text:string)
Indirect call: waits for the next server tick.
Sourcepub async fn send_to_clipboard_async(
&self,
player: impl AsRef<[u8]>,
text: impl AsRef<[u8]>,
) -> Result<()>
pub async fn send_to_clipboard_async( &self, player: impl AsRef<[u8]>, text: impl AsRef<[u8]>, ) -> Result<()>
Self::send_to_clipboard without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn send_to_debug_card(
&self,
address: impl AsRef<[u8]>,
data: &[Value],
) -> Result<()>
pub fn send_to_debug_card( &self, address: impl AsRef<[u8]>, data: &[Value], ) -> Result<()>
Sends data to the debug card with the specified address.
Lua: debug.sendToDebugCard(address:string, data...)
Indirect call: waits for the next server tick.
Sourcepub async fn send_to_debug_card_async(
&self,
address: impl AsRef<[u8]>,
data: &[Value],
) -> Result<()>
pub async fn send_to_debug_card_async( &self, address: impl AsRef<[u8]>, data: &[Value], ) -> Result<()>
Self::send_to_debug_card without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn test(&self) -> Result<Handle>
pub fn test(&self) -> Result<Handle>
Test method for user-data and general value conversion.
Lua: debug.test():userdata
Indirect call: waits for the next server tick.
Sourcepub async fn test_async(&self) -> Result<Handle>
pub async fn test_async(&self) -> Result<Handle>
Self::test 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 Debug
impl Component for Debug
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.