Struct oc2_hlapi::device::RobotDevice
source · pub struct RobotDevice(/* private fields */);Trait Implementations§
source§impl RobotInterface for RobotDevice
impl RobotInterface for RobotDevice
source§fn get_energy_stored(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
fn get_energy_stored(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
Returns the amount of FE stored in a robot.
source§fn get_energy_capacity(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
fn get_energy_capacity(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
Returns the maximum possible energy that a robot can store.
source§fn get_selected_slot(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
fn get_selected_slot(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
Returns the index of the currently active slot.
source§fn set_selected_slot(&self, slot: i32) -> Result<()>where
(): DeserializeOwned + 'static,
fn set_selected_slot(&self, slot: i32) -> Result<()>where
(): DeserializeOwned + 'static,
Sets the currently active slot to the given index.
source§fn get_stack_in_slot<T>(&self, slot: i32) -> Result<T>where
T: DeserializeOwned + 'static,
fn get_stack_in_slot<T>(&self, slot: i32) -> Result<T>where
T: DeserializeOwned + 'static,
Returns information about the item in the given slot.
source§fn queue_move(&self, direction: Direction) -> Result<bool>where
bool: DeserializeOwned + 'static,
fn queue_move(&self, direction: Direction) -> Result<bool>where
bool: DeserializeOwned + 'static,
Attempts to queue an action which moves the robot in the given direction. Returns true
if the action was successfully queued.
source§fn queue_turn(&self, direction: RotationDirection) -> Result<bool>where
bool: DeserializeOwned + 'static,
fn queue_turn(&self, direction: RotationDirection) -> Result<bool>where
bool: DeserializeOwned + 'static,
Attempts to queue an action which turns the robot in the given direction. Returns true
if the action was successfully queued.
source§fn get_last_action_id(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
fn get_last_action_id(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
Returns the ID of the previously performed action.
source§fn get_queued_action_count(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
fn get_queued_action_count(&self) -> Result<i32>where
i32: DeserializeOwned + 'static,
Returns the currently queued number of actions.
source§fn get_action_result(&self, id: i32) -> Result<RobotActionResult>where
RobotActionResult: DeserializeOwned + 'static,
fn get_action_result(&self, id: i32) -> Result<RobotActionResult>where
RobotActionResult: DeserializeOwned + 'static,
Returns the state of a robot’s action with a given ID.
Auto Trait Implementations§
impl Freeze for RobotDevice
impl !RefUnwindSafe for RobotDevice
impl !Send for RobotDevice
impl !Sync for RobotDevice
impl Unpin for RobotDevice
impl !UnwindSafe for RobotDevice
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more