Struct Client

Source
pub struct Client {
    pub key: String,
    pub host: String,
    pub team: Team,
    pub destinations: Arc<Mutex<Destinations>>,
    /* private fields */
}

Fields§

§key: String§host: String§team: Team§destinations: Arc<Mutex<Destinations>>

Implementations§

Source§

impl Client

Source

pub fn new(key: String, host: String, team: Team) -> RskResult<Client>

Source

pub async fn send_command( &self, team: Team, number: RobotNumber, command: Command, ) -> RskResult<()>

Source

pub fn req_process( key: &str, host: &str, rx: &Receiver<(Team, RobotNumber, Command)>, ) -> RskResult<()>

Source

pub fn sub_process( host: &str, game_data: Arc<Mutex<Option<GameData>>>, ) -> RskResult<()>

Source

pub async fn goto_process( client: Client, team: Team, number: RobotNumber, ) -> RskResult<()>

Source

pub async fn get_destinations(&self) -> RskResult<Destinations>

Source

pub fn get_game_data(&self) -> RskResult<GameData>

Source

pub fn get_robot(&self, team: Team, number: RobotNumber) -> RskResult<Robot<'_>>

Source

pub async fn is_arrived( &self, team: Team, number: RobotNumber, ) -> RskResult<bool>

Source

pub async fn get_destination( &self, team: Team, number: RobotNumber, ) -> RskResult<Option<Destination>>

Source

pub async fn set_destination( &self, team: Team, number: RobotNumber, destination: Option<Destination>, ) -> RskResult<()>

Source

pub async fn goto( &self, team: Team, number: RobotNumber, destination: Destination, ) -> RskResult<()>

Source

pub async fn stop(&self, team: Team, number: RobotNumber) -> RskResult<()>

Source

pub async fn goto_blocking( &self, team: Team, number: RobotNumber, destination: Destination, ) -> RskResult<()>

Source

pub fn get_ball(&self) -> RskResult<Position>

Source

pub async fn get_allies(&self) -> RskResult<(Robot<'_>, Robot<'_>)>

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

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 = 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>,

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.