Skip to main content

Debug

Struct Debug 

Source
pub struct Debug(pub Address);
Expand description

The debug component (15 methods).

Provided by OpenComputers’ DebugCard, DebugCardBase.

Tuple Fields§

§0: Address

Implementations§

Source§

impl Debug

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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 Clone for Debug

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 Debug

Source§

const KIND: &'static str = "debug"

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 Debug

Source§

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

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

impl Eq for Debug

Source§

impl Hash for Debug

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 Debug

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 Debug

Auto Trait Implementations§

§

impl Forget for Debug

§

impl Freeze for Debug

§

impl Move for Debug

§

impl RefUnwindSafe for Debug

§

impl Send for Debug

§

impl Sync for Debug

§

impl Unpin for Debug

§

impl UnsafeUnpin for Debug

§

impl UnwindSafe for Debug

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.