pub struct LogicalMeterHandle { /* private fields */ }Expand description
This provides an interface stream high-level metrics from a microgrid.
Implementations§
Source§impl LogicalMeterHandle
impl LogicalMeterHandle
Sourcepub async fn try_new(
client: MicrogridClientHandle,
config: LogicalMeterConfig,
) -> Result<Self, Error>
pub async fn try_new( client: MicrogridClientHandle, config: LogicalMeterConfig, ) -> Result<Self, Error>
Creates a new LogicalMeter instance.
Listing the components and connections from the API and building the
component graph is retried indefinitely with a 3 second backoff, so
this call blocks until the server is reachable and returns data that
forms a valid graph. Returns an error only if config is invalid.
Sourcepub fn grid<M: Metric>(&self) -> Result<Formula<M::QuantityType>, Error>
pub fn grid<M: Metric>(&self) -> Result<Formula<M::QuantityType>, Error>
Returns a receiver that streams samples for the given metric at the grid
connection point.
Sourcepub fn battery<M: Metric>(
&self,
component_ids: Option<BTreeSet<u64>>,
) -> Result<Formula<M::QuantityType>, Error>
pub fn battery<M: Metric>( &self, component_ids: Option<BTreeSet<u64>>, ) -> Result<Formula<M::QuantityType>, Error>
Returns a receiver that streams samples for the given metric for the
given battery IDs.
When component_ids is None, all batteries in the microgrid are used.
Sourcepub fn chp<M: Metric>(
&self,
component_ids: Option<BTreeSet<u64>>,
) -> Result<Formula<M::QuantityType>, Error>
pub fn chp<M: Metric>( &self, component_ids: Option<BTreeSet<u64>>, ) -> Result<Formula<M::QuantityType>, Error>
Returns a receiver that streams samples for the given metric for the
given CHP IDs.
When component_ids is None, all CHPs in the microgrid are used.
Sourcepub fn pv<M: Metric>(
&self,
component_ids: Option<BTreeSet<u64>>,
) -> Result<Formula<M::QuantityType>, Error>
pub fn pv<M: Metric>( &self, component_ids: Option<BTreeSet<u64>>, ) -> Result<Formula<M::QuantityType>, Error>
Returns a receiver that streams samples for the given metric for the
given PV IDs.
When component_ids is None, all PVs in the microgrid are used.
Sourcepub fn ev_charger<M: Metric>(
&self,
component_ids: Option<BTreeSet<u64>>,
) -> Result<Formula<M::QuantityType>, Error>
pub fn ev_charger<M: Metric>( &self, component_ids: Option<BTreeSet<u64>>, ) -> Result<Formula<M::QuantityType>, Error>
Returns a receiver that streams samples for the given metric for the
given EV charger IDs.
When component_ids is None, all EV chargers in the microgrid are
used.
Sourcepub fn consumer<M: Metric>(&self) -> Result<Formula<M::QuantityType>, Error>
pub fn consumer<M: Metric>(&self) -> Result<Formula<M::QuantityType>, Error>
Returns a receiver that streams samples for the given metric for the
logical consumer in the microgrid.
Sourcepub fn producer<M: Metric>(&self) -> Result<Formula<M::QuantityType>, Error>
pub fn producer<M: Metric>(&self) -> Result<Formula<M::QuantityType>, Error>
Returns a receiver that streams samples for the given metric for the
logical producer in the microgrid.
Sourcepub fn component<M: Metric>(
&self,
component_id: u64,
) -> Result<Formula<M::QuantityType>, Error>
pub fn component<M: Metric>( &self, component_id: u64, ) -> Result<Formula<M::QuantityType>, Error>
Returns a receiver that streams samples for the given metric for the
given component ID.
Sourcepub fn graph(
&self,
) -> &ComponentGraph<ElectricalComponent, ElectricalComponentConnection>
pub fn graph( &self, ) -> &ComponentGraph<ElectricalComponent, ElectricalComponentConnection>
Returns a reference to the component graph.
Trait Implementations§
Source§impl Clone for LogicalMeterHandle
impl Clone for LogicalMeterHandle
Source§fn clone(&self) -> LogicalMeterHandle
fn clone(&self) -> LogicalMeterHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LogicalMeterHandle
impl RefUnwindSafe for LogicalMeterHandle
impl Send for LogicalMeterHandle
impl Sync for LogicalMeterHandle
impl Unpin for LogicalMeterHandle
impl UnsafeUnpin for LogicalMeterHandle
impl UnwindSafe for LogicalMeterHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request