Struct oc2_hlapi::device::RobotDevice

source ·
pub struct RobotDevice(/* private fields */);

Trait Implementations§

source§

impl RobotInterface for RobotDevice

source§

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,

Returns the maximum possible energy that a robot can store.
source§

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,

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,

Returns information about the item in the given slot.
source§

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,

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,

Returns the ID of the previously performed action.
source§

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>

Returns the state of a robot’s action with a given ID.
source§

impl RpcDevice for RobotDevice

source§

const IDENTIFIER: &'static str = "robot"

source§

fn new(id: Uuid, bus: &DeviceBus) -> Self

source§

fn id(&self) -> Uuid

source§

fn bus(&self) -> &DeviceBus

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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.