pub struct StravaAPI { /* private fields */ }Expand description
Entry point into the Strava API wrapper.
StravaAPI is cheap to clone: it only contains an Arc reference to the
shared token. Mutating the token via StravaAPI::set_token is visible to
all clones, which lets long-running applications refresh the access token
without rebuilding the whole call stack.
Implementations§
Source§impl StravaAPI
impl StravaAPI
pub fn new(url: &str, token: impl Into<String>) -> Self
Sourcepub fn set_token(&self, token: impl Into<String>)
pub fn set_token(&self, token: impl Into<String>)
Replaces the access token. Use after calling
auth::refresh_token to swap the expired
access token for the newly issued one.
Sourcepub fn rate_limit(&self) -> Option<RateLimit>
pub fn rate_limit(&self) -> Option<RateLimit>
Latest rate-limit snapshot observed from any Strava response in this
process. Returns None until the first request with valid
X-RateLimit-* headers lands.
Strava rate limits are per-application, so the snapshot is shared
across every StravaAPI instance in the process.
pub fn activities(&self) -> ActivitiesEndpoint
pub fn athlete(&self) -> AthleteEndpoint
pub fn athletes(&self) -> AthletesEndpoint
pub fn clubs(&self) -> ClubsEndpoint
pub fn gear(&self) -> GearEndpoint
pub fn routes(&self) -> RoutesEndpoint
pub fn segments(&self) -> SegmentsEndpoint
pub fn streams(&self) -> StreamsEndpoint
pub fn uploads(&self) -> UploadsEndpoint
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StravaAPI
impl RefUnwindSafe for StravaAPI
impl Send for StravaAPI
impl Sync for StravaAPI
impl Unpin for StravaAPI
impl UnsafeUnpin for StravaAPI
impl UnwindSafe for StravaAPI
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