pub struct LinkyApiClientImpl { /* private fields */ }Expand description
Production Linky API client implementation
Implements OAuth2 authorization code flow and data fetching from Enedis Linky API and ORES (Belgium) API
Implementations§
Trait Implementations§
Source§impl LinkyApiClient for LinkyApiClientImpl
impl LinkyApiClient for LinkyApiClientImpl
Exchange OAuth2 authorization code for access token + refresh token
Source§fn refresh_access_token<'life0, 'life1, 'async_trait>(
&'life0 self,
refresh_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OAuth2TokenResponse, LinkyApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn refresh_access_token<'life0, 'life1, 'async_trait>(
&'life0 self,
refresh_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OAuth2TokenResponse, LinkyApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Refresh OAuth2 access token using refresh token
Source§fn get_daily_consumption<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prm: &'life1 str,
access_token: &'life2 str,
start_date: DateTime<Utc>,
end_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_daily_consumption<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prm: &'life1 str,
access_token: &'life2 str,
start_date: DateTime<Utc>,
end_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get daily electricity consumption (30-minute granularity)
Returns consumption data for each day in the range
Source§fn get_monthly_consumption<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prm: &'life1 str,
access_token: &'life2 str,
start_date: DateTime<Utc>,
end_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_monthly_consumption<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prm: &'life1 str,
access_token: &'life2 str,
start_date: DateTime<Utc>,
end_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get monthly electricity consumption (aggregated by month)
Source§fn get_consumption_load_curve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prm: &'life1 str,
access_token: &'life2 str,
start_date: DateTime<Utc>,
end_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_consumption_load_curve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prm: &'life1 str,
access_token: &'life2 str,
start_date: DateTime<Utc>,
end_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ConsumptionDataPoint>, LinkyApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get consumption load curve (granularity: 30 minutes)
High-frequency data for detailed analysis
Source§fn get_max_power<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prm: &'life1 str,
access_token: &'life2 str,
start_date: DateTime<Utc>,
end_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PowerDataPoint>, LinkyApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_max_power<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prm: &'life1 str,
access_token: &'life2 str,
start_date: DateTime<Utc>,
end_date: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<Vec<PowerDataPoint>, LinkyApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get maximum power draw (kW) over a period
Auto Trait Implementations§
impl Freeze for LinkyApiClientImpl
impl !RefUnwindSafe for LinkyApiClientImpl
impl Send for LinkyApiClientImpl
impl Sync for LinkyApiClientImpl
impl Unpin for LinkyApiClientImpl
impl !UnwindSafe for LinkyApiClientImpl
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.