pub struct Command {
pub payload: CommandPayload,
pub expires_after_tick: TickId,
pub source_id: Option<u64>,
pub source_seq: Option<u64>,
pub priority_class: u8,
pub arrival_seq: u64,
}Expand description
A command submitted to the simulation via the ingress pipeline.
Commands are ordered by priority_class (lower = higher priority),
then by source_id for disambiguation, then by arrival_seq as
a final tiebreaker.
§Examples
use murk_core::{Command, CommandPayload, FieldId, TickId, ParameterKey};
// A command that sets a global parameter.
let cmd = Command {
payload: CommandPayload::SetParameter {
key: ParameterKey(0),
value: 2.5,
},
expires_after_tick: TickId(100),
source_id: Some(1),
source_seq: Some(0),
priority_class: 1,
arrival_seq: 0,
};
assert_eq!(cmd.priority_class, 1);
assert_eq!(cmd.expires_after_tick, TickId(100));Fields§
§payload: CommandPayloadThe operation to perform.
expires_after_tick: TickIdThe command expires if not applied by this tick.
source_id: Option<u64>Optional source identifier for deduplication and ordering.
source_seq: Option<u64>Optional per-source sequence number for ordering.
priority_class: u8Priority class. Lower values = higher priority. 0 = system, 1 = user default.
arrival_seq: u64Monotonic arrival sequence number, set by the ingress pipeline.
Trait Implementations§
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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