[][src]Struct brawlhalla::ConnectionBuilder

pub struct ConnectionBuilder<'a> { /* fields omitted */ }

Builder struct for an APIConnection.

You would use it like this:

extern crate brawlhalla;
use brawlhalla::ConnectionBuilder;

#[tokio::main]
async fn main() -> Result<(), brawlhalla::APIError> {
    let steamid: u64 = 42069;
    ConnectionBuilder::default()
    .with_apikey("your_apikey")
    .build()
    .search_by_steam_id(steamid)
    .await?;
    println!("{}", steamid);
    Ok(())
}

Methods

impl<'a> ConnectionBuilder<'a>[src]

pub fn with_apikey(self, apikey: &'a str) -> Self[src]

Configures an API Key for your builder

pub fn with_apiurl(self, apiurl: &'a str) -> Self[src]

Configures the API URL for the builder. You will probably never need this function.

pub fn build(self) -> APIConnection[src]

Builds an APIConnection struct from your builder.

pub fn new(apikey: &'a str, apiurl: &'a str) -> Self[src]

This constructor is probably not what you want, use ConnectionBuilder::default() instead. Creates a builder struct with a custom API URL. This allows you to call any API that works like the official Brawlhalla API.

Trait Implementations

impl<'a> Default for ConnectionBuilder<'a>[src]

fn default() -> Self[src]

The default constructor for the builder. This is probably the constructor you want to use.

Auto Trait Implementations

impl<'a> RefUnwindSafe for ConnectionBuilder<'a>

impl<'a> Send for ConnectionBuilder<'a>

impl<'a> Sync for ConnectionBuilder<'a>

impl<'a> Unpin for ConnectionBuilder<'a>

impl<'a> UnwindSafe for ConnectionBuilder<'a>

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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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.