[][src]Struct brawl_api::model::players::battlelog::BattleResultInfo

pub struct BattleResultInfo {
    pub mode: String,
    pub battle_type: Option<String>,
    pub duration: usize,
    pub trophy_change: isize,
    pub rank: Option<u8>,
    pub result: Option<BattleOutcome>,
    pub star_player: Option<BattlePlayer>,
    pub teams: Option<Vec<Vec<BattlePlayer>>>,
    pub players: Option<Vec<BattlePlayer>>,
}

Represents the result of a battle in a Battle object, including details, outcome, players/teams etc.

There are three general models of fields here:

  • Team modes (Bounty, Gem Grab, Duo Showdown...): fields mode, battle_type, duration, trophy_change, result, star_player, teams
  • Solo modes (Solo Showdown): fields mode, battle_type, duration, trophy_change, rank, players
  • Weekend events: Depends on the event. Should always be there: mode, duration.
    • Here, trophy_change is always equal to 0.
    • Boss fight: mode, duration, players
    • Big Brawler: mode, duration, result, star_player, teams (needs testing!)
    • Robo Rumble: mode, duration, players (needs testing!)

Fields

mode: String

The event mode (e.g. "brawlBall", "soloShowdown"...). Should be the same as BattleEvent.mode.

battle_type: Option<String>

The type of battle (e.g. "ranked").

If this is None, then this is likely a weekend event.

duration: usize

The duration of this battle, in seconds.

trophy_change: isize

The difference in trophies applied to the player after the battle. E.g. -4 (lost 4 trophies)

This is always 0 for weekend events and practice.

rank: Option<u8>

If this was a solo mode match, then this is the player's final rank (1-10). Otherwise, None.

result: Option<BattleOutcome>

If this was a match with teams, then this is the outcome for the player (Victory/Defeat/Draw), otherwise None.

star_player: Option<BattlePlayer>

The data indicating who was the Star Player in the match. This is generally from the winning team, unless a draw occurred, in which case it can be from either team. If this was a solo mode or boss fight match, for instance, then there is no star player (None).

teams: Option<Vec<Vec<BattlePlayer>>>

If this was a match with teams, then this is a vector with all teams of players (as vectors) - this can be the teams in a teamed mode such as Bounty, or the pairs in Duo Showdown, for example. Otherwise, None.

players: Option<Vec<BattlePlayer>>

If this was a solo match or a mode without teams, such as Showdown, then this is a vector with all the players in the match. Otherwise, None.

Trait Implementations

impl Clone for BattleResultInfo[src]

impl Debug for BattleResultInfo[src]

impl Default for BattleResultInfo[src]

fn default() -> BattleResultInfo[src]

Returns an instance of BattleResultInfo with initial values.

Examples

use brawl_api::BattleResultInfo;

assert_eq!(
    BattleResultInfo::default(),
    BattleResultInfo {
        mode: String::from(""),
        battle_type: Some(String::from("")),
        duration: 0,
        trophy_change: 0,
        rank: None,
        star_player: None,
        result: None,
        teams: None,
        players: None,
    }
);

impl<'de> Deserialize<'de> for BattleResultInfo[src]

impl Eq for BattleResultInfo[src]

impl Hash for BattleResultInfo[src]

impl PartialEq<BattleResultInfo> for BattleResultInfo[src]

impl Serialize for BattleResultInfo[src]

impl StructuralEq for BattleResultInfo[src]

impl StructuralPartialEq for BattleResultInfo[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> FetchFrom<T> for T where
    T: Clone + Send + Sync
[src]

fn fetch_from(&Client, &T) -> Result<T, Error>[src]

(Sync) Returns a copy of the current instance when attempting to fetch from itself. In order to re-fetch, see Refetchable.

Errors

Never errors; is only a Result in order to match the trait signature.

fn a_fetch_from<'life0, 'life1, 'async_trait>(
    &'life0 Client,
    &'life1 T
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + 'async_trait + Send>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    T: 'async_trait, 
[src]

(Async) Returns a copy of the current instance when attempting to fetch from itself. In order to re-fetch, see Refetchable.

Errors

Never errors; is only a Result in order to match the trait signature.

impl<T, U> FetchInto<U> for T where
    T: Sync + Send,
    U: FetchFrom<T> + Sync + Send
[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.