pub struct Setpoint {
pub asset: AssetId,
pub command: Command,
pub reason: Reason,
pub at: OffsetDateTime,
}Expand description
One command for one asset, with its reason and its time.
Fields§
§asset: AssetIdThe asset this is aimed at.
command: CommandWhat to do.
reason: ReasonWhy.
at: OffsetDateTimeWhen the decision was made.
Implementations§
Source§impl Setpoint
impl Setpoint
Sourcepub fn new(
asset: AssetId,
command: Command,
reason: Reason,
at: OffsetDateTime,
) -> Result<Self, SetpointError>
pub fn new( asset: AssetId, command: Command, reason: Reason, at: OffsetDateTime, ) -> Result<Self, SetpointError>
Build a setpoint, refusing a command that carries a non-finite number.
This is the one place hems checks for NaN: quantities are constructed
cheaply and infallibly everywhere else, and the gate sits where a number
turns into an action on a physical device.
§Errors
SetpointError::NotFinite when the command contains NaN or infinity.
The authority behind this setpoint.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Setpoint
impl<'de> Deserialize<'de> for Setpoint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Setpoint
Auto Trait Implementations§
impl Freeze for Setpoint
impl RefUnwindSafe for Setpoint
impl Send for Setpoint
impl Sync for Setpoint
impl Unpin for Setpoint
impl UnsafeUnpin for Setpoint
impl UnwindSafe for Setpoint
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