[][src]Struct brawl_api::http::client::Client

pub struct Client {
    pub auth_key: String,
    // some fields omitted
}

Fields

auth_key: String

Methods

impl Client[src]

Represents an HTTP client which holds the user's API auth key, and is required on every fetch method for authentication. This is usually the starting point for using this library.

See the Client::new method to start.

pub fn new(auth_key: &str) -> Client[src]

Creates a new Client with a given API auth key.

Examples

use brawl_api::Client;

let my_client = Client::new("my auth key");

pub fn inner(&self) -> &ReqClient[src]

(For sync usage) Provides an immutable reference to the inner field.

pub fn inner_mut(&mut self) -> &mut ReqClient[src]

(For sync usage) Provides a mutable reference to the inner field.

pub fn a_inner(&self) -> &AReqClient[src]

(For async usage) Provides an immutable reference to the a_inner field.

pub fn a_inner_mut(&mut self) -> &mut AReqClient[src]

(For async usage) Provides a mutable reference to the a_inner field.

pub fn endpoint_request(&self, endpoint: &str) -> Request[src]

Creates a Request instance for one specific endpoint and returns it.

Trait Implementations

impl Clone for Client[src]

impl Debug for Client[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

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> 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.