pub struct GarminClient { /* private fields */ }Expand description
Garmin Connect API client
Implementations§
Source§impl GarminClient
impl GarminClient
Sourcepub async fn get(&self, token: &OAuth2Token, path: &str) -> Result<Response>
pub async fn get(&self, token: &OAuth2Token, path: &str) -> Result<Response>
Make an authenticated GET request and return the response
Sourcepub async fn get_json<T: DeserializeOwned>(
&self,
token: &OAuth2Token,
path: &str,
) -> Result<T>
pub async fn get_json<T: DeserializeOwned>( &self, token: &OAuth2Token, path: &str, ) -> Result<T>
Make an authenticated GET request and deserialize JSON response
Sourcepub async fn post_json(
&self,
token: &OAuth2Token,
path: &str,
body: &Value,
) -> Result<Value>
pub async fn post_json( &self, token: &OAuth2Token, path: &str, body: &Value, ) -> Result<Value>
Make an authenticated POST request with JSON body
Auto Trait Implementations§
impl Freeze for GarminClient
impl !RefUnwindSafe for GarminClient
impl Send for GarminClient
impl Sync for GarminClient
impl Unpin for GarminClient
impl !UnwindSafe for GarminClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more