Struct Team

Source
pub struct Team {
    pub team_number: u32,
    /* private fields */
}
Expand description

A struct used to access an FTC team.

Do not create this struct yourself. Instead use your Client instance.

Fields§

§team_number: u32

Implementations§

Source§

impl Team

Source

pub fn wins(&self) -> u32

The total amount of times the team has won a match.

This method takes no arguments.

It returns a u32 integer.

Source

pub fn losses(&self) -> u32

The total amount of times the team has lost a match.

This method takes no arguments.

It returns a u32 integer.

Source

pub fn ties(&self) -> u32

The amount of times the team has tied a match.

This method takes no arguments.

It returns a u32 integer.

Source

pub fn properties(&self) -> HashMap<String, String, RandomState>

Basic information of the team.

This method takes no arguments.

It returns a HashMap<String, String>.

§Panics

This method can panic in the following ways:

  • The HTTP request was not successful
  • The data received from the API was invalid JSON
  • The data received was in the wrong format
Source

pub fn season_wins(&self, season: Season) -> f64

The amount of times the team has won in a particular season

§Arguments
§Panics

This method will panic if the data sent by the API was in the wrong format.

Source

pub fn season_losses(&self, season: Season) -> f64

The amount of times the team has lost in a particular season

§Arguments
§Panics

This method will panic if the data sent by the API was in the wrong format.

Source

pub fn season_ties(&self, season: Season) -> f64

The amount of times the team has tied a match in a particular season

§Arguments
§Panics

This method will panic if the data sent by the API was in the wrong format.

Source

pub fn opr(&self, season: Season) -> f64

OPR stands for Offensive Power Rating.

This is a system that attempts to deduce the average point contribution of a team to an alliance.

Penalties are also factored in.

§Arguments
§Panics

This method will panic if the data sent by the API was in the wrong format.

Source

pub fn np_opr(&self, season: Season) -> f64

NP_OPR is the OPR without penalties.

§Arguments
§Panics

This method will panic if the data sent by the API was in the wrong format.

Source

pub fn ranking_points(&self, season: Season) -> f64

Ranking points are the number of points scored by the losing alliance in a qualification match. If you win the match, then the RP awarded to you is the score of your opponent alliance (which lost). If you lose the match, then the RP awarded to you is your own alliance’s score.

§Arguments
§Panics

This method will panic if the data sent by the API was in the wrong format.

Source

pub fn qualifying_points(&self, season: Season) -> f64

Winning teams of a qualifying match each receive 2 QP. Losing teams receive 0. If a match ends in a tie, all four teams receive 1 QP.

§Arguments
§Panics

This method will panic if the data sent by the API was in the wrong format.

Source

pub fn tiebreaker_points(&self, season: Season) -> f64

Tiebreaker points are the pre-penalty score of the losing alliance for each match. This method returns the total tiebreaker points of a team in one season.

§Arguments
§Panics

This method will panic if the data sent by the API was in the wrong format.

Source

pub fn events(&self, season: Season) -> HashMap<String, Event, RandomState>

Auto Trait Implementations§

§

impl Freeze for Team

§

impl RefUnwindSafe for Team

§

impl Send for Team

§

impl Sync for Team

§

impl Unpin for Team

§

impl UnwindSafe for Team

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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>,

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,