Skip to main content

SimObject

Trait SimObject 

Source
pub trait SimObject:
    Clone
    + Debug
    + Display
    + Unique
    + TotalBytes
    + Unpin
    + 'static { }
Expand description

A super-trait that objects that are passed around the simulation have to implement

This is the minimum object contract required by ports, flow controls, tracking, and most test harnesses. The trait intentionally combines data movement concerns (Clone, Unpin, 'static), diagnostics (Debug, Display), observability (Unique), and bandwidth modelling (TotalBytes). Components that route objects require Routable separately.

  • Clone: Allows applications and components to retain copies of values sent through the simulation, including values such as Vec that are not Copy.
  • Debug and Display: Support diagnostic and trace output.
  • Unique: Supplies the value’s tracking ID.
  • TotalBytes: Supplies the size used by bandwidth and rate models.
  • Unpin: Allows values to be moved out of port futures safely.
  • 'static: Allows port futures containing values to be owned by spawned simulation tasks.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SimObject for i32

Source§

impl SimObject for usize

Implementors§