syren 0.6.0

A parallel Rust framework for agent-based models with ECS storage, scheduling, messaging, environments, and optional GPU execution.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! RAII phase guards for the ECS read/write phase lock.
//!
//! These zero-cost token types prove at compile time that the caller holds the
//! appropriate phase lock before accessing `ECSData`.

use std::sync::{RwLockReadGuard, RwLockWriteGuard};

/// RAII guard representing the ECS read phase.
/// Holding this guard guarantees that no exclusive (structural) access exists.
#[allow(dead_code)]
pub struct PhaseRead<'a>(pub(super) RwLockReadGuard<'a, ()>);
/// RAII guard representing the ECS write (exclusive) phase.
/// Holding this guard guarantees no other readers or writers exist.
#[allow(dead_code)]
pub struct PhaseWrite<'a>(pub(super) RwLockWriteGuard<'a, ()>);