pub trait SimObject:
Clone
+ Debug
+ Display
+ Unique
+ TotalBytes
+ 'static { }Expand description
A super-trait that objects that are passed around the simulation have to implement
- Clone: It would be nice to use
Copyinstead, but given that things likeVecare notCopywe have to useCloneinstead to allow the application to keep copies of objects sent around. - Debug: In order to print “{:?}” objects have to at least implement Debug. We could require Display, but that requires explicit implementation.
- Routable: Allows routing.
- TotalBytes: Allows rate limiting.
- Unique: Allows for unique identification of
Entities. - ’static: Due to the way that futures are implemented, the lifetimes
need to be
static. This means that objects may have to be placed inBox` to make the static.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.