pub struct BoincUseCases { /* private fields */ }Expand description
Use cases pour la gestion du calcul distribué BOINC. Gère le cycle de vie des tâches + consentement GDPR.
Architecture hexagonale: dépend des ports (traits), pas des adapters. L’adapter concret (BoincGridAdapter) est injecté à la construction.
Implementations§
Source§impl BoincUseCases
impl BoincUseCases
pub fn new( grid_port: Arc<dyn GridParticipationPort>, iot_repo: Arc<dyn IoTRepository>, ) -> Self
Sourcepub async fn submit_optimisation_task(
&self,
dto: SubmitOptimisationTaskDto,
) -> Result<GridTaskResponseDto, String>
pub async fn submit_optimisation_task( &self, dto: SubmitOptimisationTaskDto, ) -> Result<GridTaskResponseDto, String>
Soumet une tâche d’optimisation énergétique groupée à BOINC.
GDPR: vérifie le consentement explicite AVANT toute soumission. Anonymisation: les données kWh sont agrégées (pas de PII dans la tâche).
Sourcepub async fn grant_consent(
&self,
owner_id: Uuid,
org_id: Uuid,
ip: Option<&str>,
) -> Result<BoincConsent, String>
pub async fn grant_consent( &self, owner_id: Uuid, org_id: Uuid, ip: Option<&str>, ) -> Result<BoincConsent, String>
Accorde le consentement BOINC pour un propriétaire (GDPR Art. 7).
Sourcepub async fn revoke_consent(&self, owner_id: Uuid) -> Result<(), String>
pub async fn revoke_consent(&self, owner_id: Uuid) -> Result<(), String>
Révoque le consentement BOINC (GDPR Art. 7.3 - droit de retrait).
Sourcepub async fn get_consent(
&self,
owner_id: Uuid,
) -> Result<Option<BoincConsent>, String>
pub async fn get_consent( &self, owner_id: Uuid, ) -> Result<Option<BoincConsent>, String>
Récupère le consentement courant d’un propriétaire.
Auto Trait Implementations§
impl Freeze for BoincUseCases
impl !RefUnwindSafe for BoincUseCases
impl Send for BoincUseCases
impl Sync for BoincUseCases
impl Unpin for BoincUseCases
impl !UnwindSafe for BoincUseCases
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.