Struct libhealth::sync::google_fit::GoogleFitSyncProvider
source · pub struct GoogleFitSyncProvider { /* private fields */ }
Implementations§
source§impl GoogleFitSyncProvider
impl GoogleFitSyncProvider
pub fn new(sender: Sender<DatabaseValue>) -> Self
Trait Implementations§
source§impl Clone for GoogleFitSyncProvider
impl Clone for GoogleFitSyncProvider
source§fn clone(&self) -> GoogleFitSyncProvider
fn clone(&self) -> GoogleFitSyncProvider
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for GoogleFitSyncProvider
impl Debug for GoogleFitSyncProvider
source§impl SyncProvider for GoogleFitSyncProvider
impl SyncProvider for GoogleFitSyncProvider
source§fn reauthenticate(&mut self) -> Result<()>
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<()>
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<()>
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<()>
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
fn provider_name(&self) -> &'static str
Returns the name of the provider (which is used for storing it in the keyring).
source§fn oauth2_token(
&mut self
) -> Result<StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>>
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 exchange_refresh_token(
&self,
client: &BasicClient
) -> Result<StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>>
fn exchange_refresh_token( &self, client: &BasicClient ) -> Result<StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>>
Exchange a refresh token for an access token.
source§fn token(&self) -> Result<Option<RefreshToken>>
fn token(&self) -> Result<Option<RefreshToken>>
Retrieve the RefreshToken from the secret store. Read more
source§fn set_token(&self, value: RefreshToken) -> Result<()>
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)>
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 moreAuto Trait Implementations§
impl RefUnwindSafe for GoogleFitSyncProvider
impl Send for GoogleFitSyncProvider
impl Sync for GoogleFitSyncProvider
impl Unpin for GoogleFitSyncProvider
impl UnwindSafe for GoogleFitSyncProvider
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