[][src]Struct rustoa::Client

pub struct Client { /* fields omitted */ }

The main RusTOA client.

You can use the Client to get the API version and create a Team object.

Implementations

impl Client[src]

pub fn new(api_key: &str) -> Client[src]

Create a new Client object.

Arguments

  • api_key - Your Orange Alliance API key as a String.

It returns a Client object.

pub fn api_version(&self) -> String[src]

Get the version of The Orange Alliance API that this crate is using. This method takes no arguments and returns the version as a String.

Panics

This method can panic in three ways:

  • The HTTP request to the API fails. This can be because the API is either down or you are being ratelimited.
  • Serde cannot properly deserialize the JSON data in the response. This happens because the API has sent invalid JSON.
  • The HashMap does not have the needed keys to process the data. This happens because the request was made to the wrong target or the API has sent back an error in JSON form.

pub fn team(&self, team_number: u32) -> Team[src]

This method is used to get an instance of Team.

Arguments

  • team_number - The FTC team number as a u32 integer.

It returns a Team object with the necessary data.

Trait Implementations

impl Clone for Client[src]

impl Debug for Client[src]

Auto Trait Implementations

impl RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.