pub struct ConnectionBuilder<'a> { /* private fields */ }Expand description
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(())
}Implementations§
Source§impl<'a> ConnectionBuilder<'a>
impl<'a> ConnectionBuilder<'a>
Sourcepub fn with_apikey(self, apikey: &'a str) -> Self
pub fn with_apikey(self, apikey: &'a str) -> Self
Configures an API Key for your builder
Sourcepub fn with_apiurl(self, apiurl: &'a str) -> Self
pub fn with_apiurl(self, apiurl: &'a str) -> Self
Configures the API URL for the builder. You will probably never need this function.
Sourcepub fn build(self) -> APIConnection
pub fn build(self) -> APIConnection
Builds an APIConnection struct from your builder.
Sourcepub fn new(apikey: &'a str, apiurl: &'a str) -> Self
pub fn new(apikey: &'a str, apiurl: &'a str) -> Self
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§
Auto Trait Implementations§
impl<'a> Freeze for ConnectionBuilder<'a>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more