pub struct GoogleFitSyncProvider { /* private fields */ }

Implementations§

Trait Implementations§

source§

impl Clone for GoogleFitSyncProvider

source§

fn clone(&self) -> GoogleFitSyncProvider

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GoogleFitSyncProvider

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl SyncProvider for GoogleFitSyncProvider

source§

fn reauthenticate(&mut self) -> Result<()>

Exchange the refresh token we already stored for an access token (which is valid for an hour).

source§

fn initial_authenticate(&mut self) -> Result<()>

Start the first authentication with Google Fit. This will open the user’s browser so they can authenticate with Google and store the refresh token to the secret store.

source§

fn initial_import(&mut self) -> Result<()>

Start the initial import with Google Fit. This will import all data from Google Fit to the Tracker DB.

source§

fn sync_data(&mut self) -> Result<()>

Start the sync with Google Fit. This will sync data that has been added since the last sync.

source§

fn provider_name(&self) -> &'static str

Returns the name of the provider (which is used for storing it in the keyring).
source§

fn api_url(&self) -> &'static str

Returns the URL to the API Endpoint
source§

fn oauth2_token( &mut self ) -> Result<StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>>

Gets the OAuth2 token or reauthenticates with the refresh token if no token has been set yet.
source§

fn get<T: DeserializeOwned>(&mut self, method: &str) -> Result<T>

Make a GET request against the specified method. Read more
source§

fn post<T: DeserializeOwned>(&mut self, method: &str, data: Value) -> Result<T>

Make a POST request against the specified method. Read more
source§

fn exchange_refresh_token( &self, client: &BasicClient ) -> Result<StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>>

Exchange a refresh token for an access token.
source§

fn schema(&self) -> Schema

Get the libsecret Schema used by Health
source§

fn token(&self) -> Result<Option<RefreshToken>>

Retrieve the RefreshToken from the secret store. Read more
source§

fn set_token(&self, value: RefreshToken) -> Result<()>

Set the RefreshToken in the secret store. Read more
source§

fn start_listen_server( authorize_url: &str ) -> Result<(AuthorizationCode, CsrfToken)>

Starts a server which listens for the user to finish authenticating with their OAuth2 provider and captures the OAuth2 code once the user is redirect to the server. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V