Struct screeps_api::sync::SyncApi [] [src]

pub struct SyncApi<C: Connect = HttpsConnector<HttpConnector>, T: TokenStorage = RcTokenStorage> { /* fields omitted */ }

API structure mirroring Api, but providing utilities for synchronous connection.

This structure owns both the hyper client and the tokio core. If this is not wanted, please use Api instead.

Methods

impl SyncApi<HttpsConnector<HttpConnector>, RcTokenStorage>
[src]

[src]

Opinionated method to construct a SyncApi with non-Send token storage, with HTTPS support and connecting to the default server.

Since this connects to the official server, it won't be useful without HTTPS support.

Use Config for more configuration, including choosing an HTTP only backend, or setting the url to something other than https://screep.com/api/.

impl<C: Connect, T: TokenStorage> SyncApi<C, T>
[src]

[src]

Logs in with the given username and password and gets an authentication token as the result.

The authentication token will then be stored in this client.

[src]

Registers a new account with the given username, password and optional email and returns a result. Successful results contain no information other than that of success.

This is primarily for private servers with screepsmod-auth installed. Unknown if this works on the official server.

[src]

Gets user information on the user currently logged in, including username and user id.

See Api::my_info for more information.

[src]

Gets the world shard and room name the server thinks the client should start with viewing.

See Api::world_start_room for more information.

[src]

Gets the room name the server thinks the client should start with viewing for a particular shard.

See Api::world_start_room for more information.

[src]

Get information on a number of rooms.

See Api::map_stats for more information.

[src]

Gets the overview of a room, returning totals for usually 3 intervals, 8, 180 and 1440, representing data for the past hour, data for the past 24 hours, and data for the past week respectively.

See Api::room_overview for more information.

[src]

Gets the terrain of a room, returning a 2d array of 50x50 points.

See Api::room_terrain for more information.

[src]

Gets a list of shards available on this server. Errors with a 404 error when connected to a non-sharded server.

See Api::shard_list for more information.

[src]

Gets the "status" of a room: if it is open, if it is in a novice area, if it exists.

See Api::room_status for more information.

[src]

Experimental endpoint to get all rooms in which PvP has recently occurred.

See Api::recent_pvp for more information.

[src]

Gets a list of all past leaderboard seasons, with end dates, display names, and season ids for each season.

See Api::leaderboard_season_list for more information.

[src]

Finds the rank of a user in a specific season for a specific leaderboard type.

See Api::find_season_leaderboard_rank for more information.

[src]

Finds the rank of a user for all seasons for a specific leaderboard type.

See Api::leaderboard_page for more information.

[src]

Gets a page of the leaderboard for a given season.

See Api::leaderboard_page for more information.

Methods from Deref<Target = Api<C, Client<C>, T>>

[src]

Logs in with the given username and password and returns a result containing the token.

Use logged_in.return_to(client.tokens) to let the client use the token from logging in.

[src]

Registers a new account with the given username, password and optional email and returns a result. Successful results contain no information other than that of success.

This is primarily for private servers with screepsmod-auth installed. Unknown if this works on the official server.

[src]

Gets user information on the user currently logged in, including username and user id.

[src]

Gets the world shard and room name the server thinks the client should start with viewing.

[src]

Gets the room name the server thinks the client should start with viewing for a particular shard.

[src]

Get information on a number of rooms.

[src]

Gets the overview of a room, returning totals for usually 3 intervals, 8, 180 and 1440, representing data for the past hour, data for the past 24 hours, and data for the past week respectively.

All Allowed request_intervals are not known, but at least 8, 180 and 1440 are allowed. The returned data, at the time of writing, includes 8 data points of each type, representing equal portions of the time period requested (hour for 8, day for 180, week for 1440).

[src]

Gets the terrain of a room, returning a 2d array of 50x50 points.

Does not require authentication.

[src]

Gets a list of shards available on this server. Errors with a 404 error when connected to a non-sharded server.

Does not require authentication.

[src]

Gets the "status" of a room: if it is open, if it is in a novice area, if it exists.

[src]

Experimental endpoint to get all rooms in which PvP has recently occurred, or where PvP has occurred since a certain game tick.

[src]

Gets a list of all past leaderboard seasons, with end dates, display names, and season ids for each season.

Seasons are a way of having limited time periods (usually one month) in which all rankings are reset at the beginning of, and points earned during the time period contribute to a player's rank in that season.

This method does not return any actual data, but rather just a list of valid past season, any of the ids of which can then be used to retrieve more information.

[src]

Finds the rank of a user in a specific season for a specific leaderboard type.

Will return ApiError::UserNotFound when the username does not exist, and ApiError::ResultNotFound when the user exists but does not have a rank for the given season. The user will not have a rank when either the account did not exist when the season ended, or the user either processed no power or upgraded no controllers, during the specific leaderboard season.

This is technically the same API endpoint as find_leaderboard_rank, but the result format differs when requesting a specific season from when requesting all season ranks.

[src]

Finds the rank of a user for all seasons for a specific leaderboard type.

This will return ApiError::UserNotFound if a username does not exist, and may also return an empty Vec as the result if the user does not have any ranks in the given leaderboard type (they have never contributed any global control points, or processed power, depending on the type).

[src]

Gets a page of the leaderboard for a given season.

Limit dictates how many users will be returned, maximum is 20. Higher than that will cause an InvalidParameters error message.

Offset doesn't have to be a multiple of limit, but it's most likely most useful that it is. Offset 0 will get you the start/top of the ranked list.

Trait Implementations

impl<C: Debug + Connect, T: Debug + TokenStorage> Debug for SyncApi<C, T>
[src]

[src]

Formats the value using the given formatter.

impl<C: Connect, T: TokenStorage> Deref for SyncApi<C, T>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.