pub struct WorldState {
pub clock: WorldClock,
pub state_lines: BTreeMap<StateDomain, StateLine>,
}Expand description
The full world state — a clock plus per-domain state lines.
Fields§
§clock: WorldClockThe world clock driving the simulation.
state_lines: BTreeMap<StateDomain, StateLine>Per-domain state lines.
Implementations§
Source§impl WorldState
impl WorldState
Sourcepub fn new(clock: WorldClock) -> Self
pub fn new(clock: WorldClock) -> Self
Create a world state pre-populated with the 12 default domains.
Sourcepub fn state_line_mut(&mut self, domain: &StateDomain) -> &mut StateLine
pub fn state_line_mut(&mut self, domain: &StateDomain) -> &mut StateLine
Get a mutable reference to a state line, inserting a default if the
domain doesn’t exist yet (useful for Custom domains).
Trait Implementations§
Source§impl Clone for WorldState
impl Clone for WorldState
Source§fn clone(&self) -> WorldState
fn clone(&self) -> WorldState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorldState
impl Debug for WorldState
Source§impl<'de> Deserialize<'de> for WorldState
impl<'de> Deserialize<'de> for WorldState
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
Auto Trait Implementations§
impl Freeze for WorldState
impl RefUnwindSafe for WorldState
impl Send for WorldState
impl Sync for WorldState
impl Unpin for WorldState
impl UnsafeUnpin for WorldState
impl UnwindSafe for WorldState
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