pub struct SetElectricalComponentPowerRequest {
pub electrical_component_id: u64,
pub power_type: i32,
pub power: f32,
pub request_lifetime: Option<u64>,
}Expand description
Request parameters for the RPC SetElectricalComponentPower.
Fields§
§electrical_component_id: u64The ID of the electrical component to set the output power of.
power_type: i32The requested power type.
power: f32The requested power output.
For Active power:
- This value is in watts (W).
- Negative values indicate discharge, i.e., supplying power towards the direction of the root node of the component graph.
- Positive values indicate charge, i.e., consuming power from the direction of the root node of the component graph.
For Reactive power:
- This value is in volt-amperes reactive (VAR).
- Negative values indicate capacitive reactive power, i.e., the current is leading the voltage when viewed from the perspective of the electrical component.
- Positive values indicate inductive reactive power, i.e., the current is lagging the voltage when viewed from the perspective of the electrical component.
request_lifetime: Option<u64>The duration, in seconds, until which the request will stay in effect. This duration has to be between 10 seconds and 15 minutes (including both limits), otherwise the request will be rejected. If not provided, it defaults to 60s.
Implementations§
Source§impl SetElectricalComponentPowerRequest
impl SetElectricalComponentPowerRequest
Sourcepub fn power_type(&self) -> PowerType
pub fn power_type(&self) -> PowerType
Returns the enum value of power_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_power_type(&mut self, value: PowerType)
pub fn set_power_type(&mut self, value: PowerType)
Sets power_type to the provided enum value.
Sourcepub fn request_lifetime(&self) -> u64
pub fn request_lifetime(&self) -> u64
Returns the value of request_lifetime, or the default value if request_lifetime is unset.
Trait Implementations§
Source§impl Clone for SetElectricalComponentPowerRequest
impl Clone for SetElectricalComponentPowerRequest
Source§fn clone(&self) -> SetElectricalComponentPowerRequest
fn clone(&self) -> SetElectricalComponentPowerRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Message for SetElectricalComponentPowerRequest
impl Message for SetElectricalComponentPowerRequest
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for SetElectricalComponentPowerRequest
impl PartialEq for SetElectricalComponentPowerRequest
Source§fn eq(&self, other: &SetElectricalComponentPowerRequest) -> bool
fn eq(&self, other: &SetElectricalComponentPowerRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SetElectricalComponentPowerRequest
impl StructuralPartialEq for SetElectricalComponentPowerRequest
Auto Trait Implementations§
impl Freeze for SetElectricalComponentPowerRequest
impl RefUnwindSafe for SetElectricalComponentPowerRequest
impl Send for SetElectricalComponentPowerRequest
impl Sync for SetElectricalComponentPowerRequest
impl Unpin for SetElectricalComponentPowerRequest
impl UnsafeUnpin for SetElectricalComponentPowerRequest
impl UnwindSafe for SetElectricalComponentPowerRequest
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
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>
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 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>
Wrap the input message
T in a tonic::Request