Struct battlebit_api::BBApi
source · pub struct BBApi(/* private fields */);Expand description
BattleBit API Struct
Implementations§
source§impl BBApi
impl BBApi
sourcepub fn new() -> BBApi
pub fn new() -> BBApi
Shorthand for BBApi::Default()
Creates a new BBApi with the default URL
Examples found in repository?
examples/serverlist.rs (line 4)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
fn main() {
let api = BBApi::new();
let server_list = api.server_list()
.expect("Retrieving server list");
server_list.into_iter().for_each(|server| {
println!("{} [{}, {}, {}] ({}, {}, {})",
server.name(),
server.gamemode(),
server.map(),
server.map_size(),
server.hz(),
server.anti_cheat(),
server.build()
)
});
}sourcepub fn server_list(&self) -> Result<Vec<ServerData>, Error>
pub fn server_list(&self) -> Result<Vec<ServerData>, Error>
Fetches the server list and puts it into a Vec<ServerData>
Examples found in repository?
examples/serverlist.rs (line 5)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
fn main() {
let api = BBApi::new();
let server_list = api.server_list()
.expect("Retrieving server list");
server_list.into_iter().for_each(|server| {
println!("{} [{}, {}, {}] ({}, {}, {})",
server.name(),
server.gamemode(),
server.map(),
server.map_size(),
server.hz(),
server.anti_cheat(),
server.build()
)
});
}Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for BBApi
impl Send for BBApi
impl Sync for BBApi
impl Unpin for BBApi
impl UnwindSafe for BBApi
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