pub struct PropertyGraph { /* private fields */ }Expand description
Owner-thread bridge between shared values and Pax’s local reactive graph.
The wake callback may run on any publishing thread. It must schedule host
work, never enter the engine inline. Enter this graph while constructing
bindings; call Self::import at a safe UI update boundary before draining
local effects. Imports coalesce by property and freeze a snapshot before any
local evaluator runs. Graphs and their local views cannot cross threads.
Implementations§
Source§impl PropertyGraph
impl PropertyGraph
Sourcepub fn new(wake: impl Fn() + Send + Sync + 'static) -> PropertyGraph
pub fn new(wake: impl Fn() + Send + Sync + 'static) -> PropertyGraph
Creates a bridge with a host-owned, transferable wake callback.
Sourcepub fn id(&self) -> u64
pub fn id(&self) -> u64
Unique attachment identity for host scheduling. It never identifies an engine pointer and is not reused after this graph closes.
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Whether publications still need an owner-thread import. Hosts recheck this after a queued wake because an intervening frame may settle them.
Sourcepub fn set_waker(&self, wake: impl Fn() + Send + Sync + 'static)
pub fn set_waker(&self, wake: impl Fn() + Send + Sync + 'static)
Installs the host scheduler after construction and wakes it if work arrived before registration. The callback must only schedule work.
Sourcepub fn enter(&self) -> PropertyGraphGuard
pub fn enter(&self) -> PropertyGraphGuard
Selects this graph for shared-to-local bindings on this thread.
Sourcepub fn import(&self) -> usize
pub fn import(&self) -> usize
Imports a finite snapshot of pending publications without running user evaluators. Publications racing this import stay pending for a later turn. Returns the number of imported properties.
Sourcepub fn import_batch(&self, limit: usize) -> usize
pub fn import_batch(&self, limit: usize) -> usize
Imports at most limit queued identities in FIFO order and requests a
further host turn if work remains. Repeated writes occupy one slot.
pub fn close(&self)
Trait Implementations§
Source§impl Clone for PropertyGraph
impl Clone for PropertyGraph
Source§fn clone(&self) -> PropertyGraph
fn clone(&self) -> PropertyGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more