#[repr(C)]pub struct SabHeader {
pub state: AtomicU64,
pub tick: AtomicU64,
pub room_min_x: AtomicU32,
pub room_min_y: AtomicU32,
pub room_max_x: AtomicU32,
pub room_max_y: AtomicU32,
pub room_bounds_seq: AtomicU32,
pub _pad: AtomicU32,
}Expand description
The header for the SharedArrayBuffer.
state packs entity_count (high 32 bits) and flip_bit (low 32 bits) into a
single AtomicU64 so that readers always observe a consistent pair with a single
acquire load, eliminating the TOCTOU window that existed when they were separate
AtomicU32 fields.
Fields§
§state: AtomicU64Packed atomic state: high 32 bits = entity_count, low 32 bits = flip_bit (0 or 1).
Updated with a single Release store in commit_write.
tick: AtomicU64The latest server tick corresponding to the data in the active buffer.
room_min_x: AtomicU32§room_min_y: AtomicU32§room_max_x: AtomicU32§room_max_y: AtomicU32§room_bounds_seq: AtomicU32Seqlock counter for room bounds. Odd = write in progress; even = stable. Writer bumps to odd before writing the four bounds fields, then to even (Release) after. Readers spin until they observe two equal even values around their reads.
_pad: AtomicU32Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SabHeader
impl RefUnwindSafe for SabHeader
impl Send for SabHeader
impl Sync for SabHeader
impl Unpin for SabHeader
impl UnsafeUnpin for SabHeader
impl UnwindSafe for SabHeader
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request