#[repr(i32)]pub enum SetElectricalComponentPowerRequestStatus {
Unspecified = 0,
Accepted = 1,
Rejected = 2,
Failed = 3,
Success = 4,
Overridden = 5,
}Expand description
Response codes for the SetElectricalComponentPowerActive and
SetElectricalComponentPowerReactive RPCs. These codes indicate the ongoing
status of the request to set the power of an electrical component.
Often, electrical components are not able to immediately set their output power to the requested value. This can happen due to several reasons, including, but not limited to:
- having to ramp up or down the power output from the current output.
- having to wait for the electrical component to reach a stable state before applying the new power set-point.
- communication latency between the API service and the electrical component.
In such cases, an initial response is sent to the client, indicating that the request has been accepted, and it is followed by a stream of responses indicating the ongoing status of the request.
Variants§
Unspecified = 0
Default value. Users are discouraged from using this value.
Accepted = 1
The request has been accepted, and the target power set-point will be applied to the electrical component.
Once the API service has received a request to set the power of an electrical component, it will validate the input parameters immediately. If the parameters are valid, the service will return this code immediately, and then proceed to apply the power set-point to the electrical component.
Rejected = 2
The request has been rejected because of invalid input parameters.
Once the API service has received a request to set the power of an electrical component, it will validate the input parameters immediately. If the parameters are invalid, the service will return this code immediately, and will not apply the power set-point to the electrical component.
Failed = 3
The request has failed midway, and the electrical component is not at the desired power level.
This code indicates that the request to set the power of an electrical component has been accepted, but the service encountered an error while applying the power set-point to the electrical component.
Success = 4
The request has been successfully processed.
Overridden = 5
The request has been overridden by another request.
This could happen if a new request to set the power of an electrical component arrives while the previous request is still being processed.
Implementations§
Source§impl SetElectricalComponentPowerRequestStatus
impl SetElectricalComponentPowerRequestStatus
Sourcepub fn is_valid(value: i32) -> bool
pub fn is_valid(value: i32) -> bool
Returns true if value is a variant of SetElectricalComponentPowerRequestStatus.
Sourcepub fn from_i32(value: i32) -> Option<SetElectricalComponentPowerRequestStatus>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<SetElectricalComponentPowerRequestStatus>
Use the TryFrom<i32> implementation instead
Converts an i32 to a SetElectricalComponentPowerRequestStatus, or None if value is not a valid variant.
Source§impl SetElectricalComponentPowerRequestStatus
impl SetElectricalComponentPowerRequestStatus
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for SetElectricalComponentPowerRequestStatus
impl Clone for SetElectricalComponentPowerRequestStatus
Source§fn clone(&self) -> SetElectricalComponentPowerRequestStatus
fn clone(&self) -> SetElectricalComponentPowerRequestStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for SetElectricalComponentPowerRequestStatus
impl Default for SetElectricalComponentPowerRequestStatus
Source§fn default() -> SetElectricalComponentPowerRequestStatus
fn default() -> SetElectricalComponentPowerRequestStatus
Source§impl From<SetElectricalComponentPowerRequestStatus> for i32
impl From<SetElectricalComponentPowerRequestStatus> for i32
Source§fn from(value: SetElectricalComponentPowerRequestStatus) -> i32
fn from(value: SetElectricalComponentPowerRequestStatus) -> i32
Source§impl Ord for SetElectricalComponentPowerRequestStatus
impl Ord for SetElectricalComponentPowerRequestStatus
Source§fn cmp(&self, other: &SetElectricalComponentPowerRequestStatus) -> Ordering
fn cmp(&self, other: &SetElectricalComponentPowerRequestStatus) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SetElectricalComponentPowerRequestStatus
impl PartialEq for SetElectricalComponentPowerRequestStatus
Source§fn eq(&self, other: &SetElectricalComponentPowerRequestStatus) -> bool
fn eq(&self, other: &SetElectricalComponentPowerRequestStatus) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SetElectricalComponentPowerRequestStatus
impl PartialOrd for SetElectricalComponentPowerRequestStatus
Source§impl TryFrom<i32> for SetElectricalComponentPowerRequestStatus
impl TryFrom<i32> for SetElectricalComponentPowerRequestStatus
Source§type Error = UnknownEnumValue
type Error = UnknownEnumValue
Source§fn try_from(
value: i32,
) -> Result<SetElectricalComponentPowerRequestStatus, UnknownEnumValue>
fn try_from( value: i32, ) -> Result<SetElectricalComponentPowerRequestStatus, UnknownEnumValue>
impl Copy for SetElectricalComponentPowerRequestStatus
impl Eq for SetElectricalComponentPowerRequestStatus
impl StructuralPartialEq for SetElectricalComponentPowerRequestStatus
Auto Trait Implementations§
impl Freeze for SetElectricalComponentPowerRequestStatus
impl RefUnwindSafe for SetElectricalComponentPowerRequestStatus
impl Send for SetElectricalComponentPowerRequestStatus
impl Sync for SetElectricalComponentPowerRequestStatus
impl Unpin for SetElectricalComponentPowerRequestStatus
impl UnsafeUnpin for SetElectricalComponentPowerRequestStatus
impl UnwindSafe for SetElectricalComponentPowerRequestStatus
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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