pub struct StateCompare {
pub state: StateId,
pub op: CompareOp,
pub value: i32,
}Expand description
One numeric term of a gate (DSL v0.10, spec-0031): this datum compares thus to this value.
It rides Gate — the shared gate, carried by every
consumer of requires_flags/forbids_flags — and not any one verb. The
comparison’s consumers are exactly the gate’s consumers (“this door opens at
500”, “this line is withheld below 200”, “this lever does nothing while the
car is moving”), so hanging it off the first verb that asked would leave the
second with no surface and make a second bespoke field look like the fix.
Fields§
§state: StateIdThe datum to read. Must be declared in the stage-5 state list
(DW0502).
op: CompareOpHow to compare it.
value: i32What to compare it against.
Implementations§
Trait Implementations§
Source§impl Clone for StateCompare
impl Clone for StateCompare
Source§impl Debug for StateCompare
impl Debug for StateCompare
Source§impl<'de> Deserialize<'de> for StateCompare
impl<'de> Deserialize<'de> for StateCompare
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 Eq for StateCompare
Source§impl JsonSchema for StateCompare
impl JsonSchema for StateCompare
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for StateCompare
impl PartialEq for StateCompare
Source§impl Serialize for StateCompare
impl Serialize for StateCompare
impl StructuralPartialEq for StateCompare
Auto Trait Implementations§
impl Freeze for StateCompare
impl RefUnwindSafe for StateCompare
impl Send for StateCompare
impl Sync for StateCompare
impl Unpin for StateCompare
impl UnsafeUnpin for StateCompare
impl UnwindSafe for StateCompare
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