1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! # teestatus
//! [![Crates.io](https://meritbadge.herokuapp.com/teestatus)](https://crates.io/crates/teestatus)
//! ![Rust](https://github.com/edg-l/teestatus/workflows/Rust/badge.svg)
//! [![Docs](https://docs.rs/teestatus/badge.svg)](https://docs.rs/teestatus)
//!
//! Request info about teeworlds servers.
//!
//! Example
//! ```rust,no_run
//! use teestatus::*;
//! use std::net::UdpSocket;
//!
//! env_logger::init();
//! let sock = UdpSocket::bind("0.0.0.0:0").expect("can't bind socket");
//! sock.connect("0.0.0.0:8303")
//!     .expect("can't connect socket");
//! println!("info: {:#?}", ServerInfo::new(&sock).unwrap());
//! ```
//! Example to fetch servers from a master server:
//! ```rust,no_run
//! use teestatus::*;
//! use std::net::UdpSocket;
//! use std::borrow::Cow;
//!
//! let master = MasterServer {
//! 	hostname: Cow::Borrowed("49.12.97.180"),
//! 	port: 8300,
//! };
//! let sock = UdpSocket::bind("0.0.0.0:0").expect("can't bind socket");
//! let servers = master.get_server_list(&sock).unwrap();
//! ```

pub mod errors;

mod server;
mod masterserver;
mod common;
mod util;

pub use common::*;
pub use server::*;
pub use masterserver::*;