forked from frequenz-floss/frequenz-microgrid-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstruction.rs
More file actions
32 lines (28 loc) · 1.11 KB
/
instruction.rs
File metadata and controls
32 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// License: MIT
// Copyright © 2025 Frequenz Energy-as-a-Service GmbH
//! Instructions that can be sent to the client actor from client handles.
use tokio::sync::{broadcast, oneshot};
use crate::{
Error,
proto::common::v1alpha8::microgrid::electrical_components::{
ElectricalComponent, ElectricalComponentConnection, ElectricalComponentTelemetry,
},
};
/// Instructions that can be sent to the client actor from client handles.
#[derive(Debug)]
pub(super) enum Instruction {
ReceiveElectricalComponentTelemetryStream {
electrical_component_id: u64,
response_tx: oneshot::Sender<broadcast::Receiver<ElectricalComponentTelemetry>>,
},
ListElectricalComponents {
electrical_component_ids: Vec<u64>,
electrical_component_categories: Vec<i32>,
response_tx: oneshot::Sender<Result<Vec<ElectricalComponent>, Error>>,
},
ListElectricalComponentConnections {
source_electrical_component_ids: Vec<u64>,
destination_electrical_component_ids: Vec<u64>,
response_tx: oneshot::Sender<Result<Vec<ElectricalComponentConnection>, Error>>,
},
}