pub struct Navigation(pub Address);Expand description
The navigation component (4 methods).
Provided by OpenComputers’ UpgradeNavigation, UpgradeNavigationBase.
Tuple Fields§
§0: AddressImplementations§
Sourcepub fn find_waypoints(&self, range: impl Into<Number>) -> Result<Value>
pub fn find_waypoints(&self, range: impl Into<Number>) -> Result<Value>
Find waypoints in the specified range.
Lua: navigation.findWaypoints(range:number):table
Indirect call: waits for the next server tick.
Sourcepub async fn find_waypoints_async(
&self,
range: impl Into<Number>,
) -> Result<Value>
pub async fn find_waypoints_async( &self, range: impl Into<Number>, ) -> Result<Value>
Self::find_waypoints without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_facing(&self) -> Result<Number>
pub fn get_facing(&self) -> Result<Number>
Get the current orientation of the robot.
Lua: navigation.getFacing():number
Indirect call: waits for the next server tick.
Sourcepub async fn get_facing_async(&self) -> Result<Number>
pub async fn get_facing_async(&self) -> Result<Number>
Self::get_facing without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_position(&self) -> Result<(Number, Number, Number)>
pub fn get_position(&self) -> Result<(Number, Number, Number)>
Get the current relative position of the robot.
Lua: navigation.getPosition():number, number, number
Indirect call: waits for the next server tick.
Sourcepub async fn get_position_async(&self) -> Result<(Number, Number, Number)>
pub async fn get_position_async(&self) -> Result<(Number, Number, Number)>
Self::get_position without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Sourcepub fn get_range(&self) -> Result<Number>
pub fn get_range(&self) -> Result<Number>
Get the operational range of the navigation upgrade.
Lua: navigation.getRange():number
Indirect call: waits for the next server tick.
Sourcepub async fn get_range_async(&self) -> Result<Number>
pub async fn get_range_async(&self) -> Result<Number>
Self::get_range without blocking: the call is queued, and
the program keeps running until the result comes back; see crate::task.
Trait Implementations§
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.