[−][src]Struct brawl_api::model::players::battlelog::BattleResultInfo
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!)
- Here,
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]
fn clone(&self) -> BattleResultInfo
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for BattleResultInfo
[src]
impl Hash for BattleResultInfo
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<BattleResultInfo> for BattleResultInfo
[src]
fn eq(&self, other: &BattleResultInfo) -> bool
[src]
fn ne(&self, other: &BattleResultInfo) -> bool
[src]
impl Serialize for BattleResultInfo
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for BattleResultInfo
[src]
impl StructuralPartialEq for BattleResultInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for BattleResultInfo
impl Send for BattleResultInfo
impl Sync for BattleResultInfo
impl Unpin for BattleResultInfo
impl UnwindSafe for BattleResultInfo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> FetchFrom<T> for T where
T: Clone + Send + Sync,
[src]
T: Clone + Send + Sync,
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]
&'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,
(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]
T: Sync + Send,
U: FetchFrom<T> + Sync + Send,
fn fetch_into(&Self, &Client) -> Result<U, Error>
[src]
fn a_fetch_into<'life0, 'life1, 'async_trait>(
&'life0 Self,
&'life1 Client
) -> Pin<Box<dyn Future<Output = Result<U, Error>> + 'async_trait + Send>> where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
U: 'async_trait,
[src]
&'life0 Self,
&'life1 Client
) -> Pin<Box<dyn Future<Output = Result<U, Error>> + 'async_trait + Send>> where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
U: 'async_trait,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,