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
impl Team
Sourcepub fn wins(&self) -> u32
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.
Sourcepub fn losses(&self) -> u32
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.
Sourcepub fn ties(&self) -> u32
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.
Sourcepub fn properties(&self) -> HashMap<String, String, RandomState>
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
Sourcepub fn season_wins(&self, season: Season) -> f64
pub fn season_wins(&self, season: Season) -> f64
The amount of times the team has won in a particular season
§Arguments
season: Season
- A rustoaSeason
object.
§Panics
This method will panic if the data sent by the API was in the wrong format.
Sourcepub fn season_losses(&self, season: Season) -> f64
pub fn season_losses(&self, season: Season) -> f64
The amount of times the team has lost in a particular season
§Arguments
season: Season
- A rustoaSeason
object.
§Panics
This method will panic if the data sent by the API was in the wrong format.
Sourcepub fn season_ties(&self, season: Season) -> f64
pub fn season_ties(&self, season: Season) -> f64
The amount of times the team has tied a match in a particular season
§Arguments
season: Season
- A rustoaSeason
object.
§Panics
This method will panic if the data sent by the API was in the wrong format.
Sourcepub fn opr(&self, season: Season) -> f64
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
season: Season
- A rustoaSeason
object.
§Panics
This method will panic if the data sent by the API was in the wrong format.
Sourcepub fn np_opr(&self, season: Season) -> f64
pub fn np_opr(&self, season: Season) -> f64
NP_OPR is the OPR without penalties.
§Arguments
season: Season
- A rustoaSeason
object.
§Panics
This method will panic if the data sent by the API was in the wrong format.
Sourcepub fn ranking_points(&self, season: Season) -> f64
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
season: Season
- A rustoaSeason
object.
§Panics
This method will panic if the data sent by the API was in the wrong format.
Sourcepub fn qualifying_points(&self, season: Season) -> f64
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
season: Season
- A rustoaSeason
object.
§Panics
This method will panic if the data sent by the API was in the wrong format.
Sourcepub fn tiebreaker_points(&self, season: Season) -> f64
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
season: Season
- A rustoaSeason
object.
§Panics
This method will panic if the data sent by the API was in the wrong format.