[−][src]Struct brawl_api::model::clubs::Club
A struct representing a Brawl Stars club, with all of its data.
Use Club::fetch
to fetch one based on tag.
Fields
tag: String
The club's tag. Note: this includes the initial '#'.
name: String
The club's name.
description: Option<String>
The club's description.
trophies: usize
The club's trophies.
required_trophies: usize
The amount of trophies required to enter on this club, or 0 if it allows any amount.
members: ClubMembers
The members in this club, as a vector of ClubMember
(note that the ClubMembers
struct is simply a smart pointer for Vec<ClubMember>
).
club_type: ClubType
The type of club (see ClubType
docs).
Trait Implementations
impl Clone for Club
[src]
impl Debug for Club
[src]
impl Default for Club
[src]
fn default() -> Club
[src]
Returns an instance of Club
with initial values.
Examples
use brawl_api::{Club, ClubType, ClubMembers}; assert_eq!( Club::default(), Club { tag: String::from(""), name: String::from(""), description: None, trophies: 0, required_trophies: 0, members: ClubMembers::default(), club_type: ClubType::Open, } );
impl<'de> Deserialize<'de> for Club
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Club
[src]
impl FetchFrom<ClubRanking> for Club
[src]
fn fetch_from(client: &Client, c_ranking: &ClubRanking) -> Result<Club>
[src]
(Sync) Fetches a Club
using data from a ClubRanking
object.
fn a_fetch_from<'life0, 'life1, 'async_trait>(
client: &'life0 Client,
c_ranking: &'life1 ClubRanking
) -> Pin<Box<dyn Future<Output = Result<Club>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
[src]
client: &'life0 Client,
c_ranking: &'life1 ClubRanking
) -> Pin<Box<dyn Future<Output = Result<Club>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
(Async) Fetches a Club
using data from a ClubRanking
object.
impl FetchFrom<PlayerClub> for Club
[src]
fn fetch_from(client: &Client, p_club: &PlayerClub) -> Result<Club>
[src]
(Sync) Fetches a Club
using data from a PlayerClub
object.
fn a_fetch_from<'life0, 'life1, 'async_trait>(
client: &'life0 Client,
p_club: &'life1 PlayerClub
) -> Pin<Box<dyn Future<Output = Result<Club>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
[src]
client: &'life0 Client,
p_club: &'life1 PlayerClub
) -> Pin<Box<dyn Future<Output = Result<Club>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
(Async) Fetches a Club
using data from a PlayerClub
object.
impl<'_> From<&'_ Club> for ClubMembers
[src]
impl<'a> From<&'a Club> for &'a ClubMembers
[src]
impl From<Club> for ClubMembers
[src]
impl GetFetchProp for Club
[src]
impl Hash for Club
[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<Club> for Club
[src]
impl PropFetchable for Club
[src]
type Property = str
fn fetch(client: &Client, tag: &str) -> Result<Club>
[src]
(Sync) Fetches a club from its tag.
Errors
This function may error:
- While requesting (will return an
Error::Request
); - After receiving a bad status code (API or other error - returns an
Error::Status
); - After a ratelimit is indicated by the API, while also specifying when it is lifted (
Error::Ratelimited
); - While parsing incoming JSON (will return an
Error::Json
).
(All of those, of course, wrapped inside an Err
.)
Examples
use brawl_api::{Client, Club, traits::*}; let my_client = Client::new("my auth token"); let club = Club::fetch(&my_client, "#CLUBTAGHERE")?; // now the data for the given club is available for use.
fn a_fetch<'life0, 'async_trait>(
client: &'life0 Client,
tag: &'async_trait str
) -> Pin<Box<dyn Future<Output = Result<Club>> + Send + 'async_trait>> where
Self: 'async_trait,
Self::Property: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
client: &'life0 Client,
tag: &'async_trait str
) -> Pin<Box<dyn Future<Output = Result<Club>> + Send + 'async_trait>> where
Self: 'async_trait,
Self::Property: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
(Async) Fetches a club from its tag.
Errors
This function may error:
- While requesting (will return an
Error::Request
); - After receiving a bad status code (API or other error - returns an
Error::Status
); - After a ratelimit is indicated by the API, while also specifying when it is lifted (
Error::Ratelimited
); - While parsing incoming JSON (will return an
Error::Json
).
(All of those, of course, wrapped inside an Err
.)
Examples
use brawl_api::{Client, Club, traits::*}; let my_client = Client::new("my auth token"); let club = Club::a_fetch(&my_client, "#CLUBTAGHERE").await?; // now the data for the given club is available for use.
impl Serialize for Club
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Club
[src]
impl StructuralPartialEq for Club
[src]
Auto Trait Implementations
impl RefUnwindSafe for Club
impl Send for Club
impl Sync for Club
impl Unpin for Club
impl UnwindSafe for Club
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> PropRouteable for T where
T: GetFetchProp,
[src]
T: GetFetchProp,
type Property = <T as GetFetchProp>::Property
fn get_route(&<T as PropRouteable>::Property) -> Route
[src]
impl<T> Refetchable for T where
T: PropFetchable<Property = <T as GetFetchProp>::Property> + GetFetchProp + Send + Sync,
<T as GetFetchProp>::Property: Sync,
<T as GetFetchProp>::Property: Send,
[src]
T: PropFetchable<Property = <T as GetFetchProp>::Property> + GetFetchProp + Send + Sync,
<T as GetFetchProp>::Property: Sync,
<T as GetFetchProp>::Property: Send,
fn refetch(&Self, &Client) -> Result<T, Error>
[src]
fn a_refetch<'life0, 'life1, 'async_trait>(
&'life0 Self,
&'life1 Client
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + 'async_trait + Send>> where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
<T as GetFetchProp>::Property: 'async_trait,
[src]
&'life0 Self,
&'life1 Client
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + 'async_trait + Send>> where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
<T as GetFetchProp>::Property: 'async_trait,
fn refetch_update(&mut self, client: &Client) -> Result<&Self>
[src]
fn a_refetch_update<'life0, 'async_trait>(
&'async_trait mut self,
client: &'life0 Client
) -> Pin<Box<dyn Future<Output = Result<&'async_trait Self>> + Send + 'async_trait>> where
Self: Send + Sync,
'life0: 'async_trait,
Self: Send + 'async_trait,
[src]
&'async_trait mut self,
client: &'life0 Client
) -> Pin<Box<dyn Future<Output = Result<&'async_trait Self>> + Send + 'async_trait>> where
Self: Send + Sync,
'life0: 'async_trait,
Self: Send + 'async_trait,
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>,