Crate strava [−] [src]
A wrapper for the Strava API
Organization
The module layout in this crate mirrors the Strava API documentation. All functions
interacting with the strava servers will return a
strava::error::Result
for which the E
parameter is curried to
strava::error::ApiError
. The module listing below includes
UNIMPLEMENTED tags to make it clear what hasn't been written yet. Modules without that tag
are not guaranteed to exhaustively wrap all endpoints for that type, but they are guaranteed to
have support for between 1..all
endpoints for that type.
Examples
The simplest thing one can do with the strava API is to get an athlete and print it out. Every
request made against the Strava API requires a valid access token. Since this example provides a
fake token, the unwrap
call will panic with an ApiError::InvalidAccessToken
. You can get a
token by registering an application on strava.com.
use strava::athletes::Athlete; use strava::api::AccessToken; // Create a token let token = AccessToken::new("<my token>".to_string()); // Get the athlete associated with the given token let athlete = Athlete::get_current(&token).unwrap(); // All of the strava types implement Debug and can be printed like so: println!("{:?}", athlete);
Modules
activities | |
api |
Shared utility types and functions for the API |
athletes |
Strava athletes and associated data |
clubs | |
error |
Error and Result types for the library |
gear | |
resources |
Types shared by primary strava resources |
segmentefforts |
Athlete attempts at a segment |
segments |
Specific sections of road and attempts an athlete has made on them |
streams |
UNIMPLEMENTED: Raw data associated with an activity |
uploads |
UNIMPLEMENTED: Upload activity file |