pub struct Client { /* private fields */ }
Expand description
Client for fetching data from the war API.
This client contains an HTTP client, and only one instance should be needed per process.
Implementations§
Source§impl Client
impl Client
pub fn new(shard: Shard) -> Self
Sourcepub async fn war_data(&self) -> Result<WarDataResponse, FoxholeApiError>
pub async fn war_data(&self) -> Result<WarDataResponse, FoxholeApiError>
Retrieves information about the current war.
This endpoint retrieves information about the current war, and returns it deserialized as
WarDataResponse
.
Sourcepub async fn map_names(&self) -> Result<MapNameResponse, FoxholeApiError>
pub async fn map_names(&self) -> Result<MapNameResponse, FoxholeApiError>
Retrieves all map names.
This endpoint retrieves all map names currently present, and returns them deserialized as
MapNameResponse
.
Sourcepub async fn map_war_report(
&self,
map_name: &str,
) -> Result<WarReportResponse, FoxholeApiError>
pub async fn map_war_report( &self, map_name: &str, ) -> Result<WarReportResponse, FoxholeApiError>
Retrieves the war report for a given map.
This endpoint retrieves the war report for a given map, and returns it deserialized as
WarReportResponse
.
Sourcepub async fn map_data_static(
&self,
map_name: &str,
) -> Result<MapDataResponse, FoxholeApiError>
pub async fn map_data_static( &self, map_name: &str, ) -> Result<MapDataResponse, FoxholeApiError>
Retrieves all static map data.
This endpoint retrieves all map data that will never change over the course of a war. This includes map text labels and resource node locations.
Sourcepub async fn map_data_dynamic(
&self,
map_name: &str,
) -> Result<MapDataResponse, FoxholeApiError>
pub async fn map_data_dynamic( &self, map_name: &str, ) -> Result<MapDataResponse, FoxholeApiError>
Retrieves all dynamic map data.
This endpoint retrieves all map daa that could change over the course of a war. This includes relic bases, and town halls that could change team ownership. Private data, such as player built fortifications, is not available.