pub struct ReactiveHandler { /* private fields */ }Expand description
Production reactive effect handler.
Implements ReactiveEffects using a SignalGraph for state management.
This handler can be shared across components via Arc.
Supports query-bound signals where the signal’s value is derived from executing a query against journal facts. When facts change, bound queries are automatically re-evaluated.
Implementations§
Source§impl ReactiveHandler
impl ReactiveHandler
Sourcepub fn with_graph(graph: Arc<SignalGraph>) -> Self
pub fn with_graph(graph: Arc<SignalGraph>) -> Self
Create a handler with a shared signal graph.
This allows multiple handlers to share the same reactive state.
Sourcepub fn with_graph_and_registry(
graph: Arc<SignalGraph>,
registered_ids: Arc<RwLock<HashSet<SignalId>>>,
) -> Self
pub fn with_graph_and_registry( graph: Arc<SignalGraph>, registered_ids: Arc<RwLock<HashSet<SignalId>>>, ) -> Self
Create a handler with shared graph and registration tracking.
Sourcepub fn graph(&self) -> &Arc<SignalGraph>
pub fn graph(&self) -> &Arc<SignalGraph>
Get a reference to the underlying signal graph.
Sourcepub async fn stats(&self) -> SignalGraphStats
pub async fn stats(&self) -> SignalGraphStats
Get statistics about the handler’s signal graph.
Trait Implementations§
Source§impl Clone for ReactiveHandler
impl Clone for ReactiveHandler
Source§impl Default for ReactiveHandler
impl Default for ReactiveHandler
Source§impl Drop for ReactiveHandler
impl Drop for ReactiveHandler
Source§impl ReactiveEffects for ReactiveHandler
impl ReactiveEffects for ReactiveHandler
Source§fn read<'life0, 'life1, 'async_trait, T>(
&'life0 self,
signal: &'life1 Signal<T>,
) -> Pin<Box<dyn Future<Output = Result<T, ReactiveError>> + Send + 'async_trait>>
fn read<'life0, 'life1, 'async_trait, T>( &'life0 self, signal: &'life1 Signal<T>, ) -> Pin<Box<dyn Future<Output = Result<T, ReactiveError>> + Send + 'async_trait>>
Read the current value of a signal. Read more
Source§fn emit<'life0, 'life1, 'async_trait, T>(
&'life0 self,
signal: &'life1 Signal<T>,
value: T,
) -> Pin<Box<dyn Future<Output = Result<(), ReactiveError>> + Send + 'async_trait>>
fn emit<'life0, 'life1, 'async_trait, T>( &'life0 self, signal: &'life1 Signal<T>, value: T, ) -> Pin<Box<dyn Future<Output = Result<(), ReactiveError>> + Send + 'async_trait>>
Emit a new value to a signal. Read more
Source§fn subscribe<T>(
&self,
signal: &Signal<T>,
) -> Result<SignalStream<T>, ReactiveError>
fn subscribe<T>( &self, signal: &Signal<T>, ) -> Result<SignalStream<T>, ReactiveError>
Subscribe to signal changes. Read more
Source§fn register<'life0, 'life1, 'async_trait, T>(
&'life0 self,
signal: &'life1 Signal<T>,
initial: T,
) -> Pin<Box<dyn Future<Output = Result<(), ReactiveError>> + Send + 'async_trait>>
fn register<'life0, 'life1, 'async_trait, T>( &'life0 self, signal: &'life1 Signal<T>, initial: T, ) -> Pin<Box<dyn Future<Output = Result<(), ReactiveError>> + Send + 'async_trait>>
Register a signal with an initial value. Read more
Source§fn is_registered(&self, signal_id: &SignalId) -> bool
fn is_registered(&self, signal_id: &SignalId) -> bool
Check if a signal is registered.
Source§fn register_query<'life0, 'life1, 'async_trait, Q>(
&'life0 self,
signal: &'life1 Signal<Q::Result>,
query: Q,
) -> Pin<Box<dyn Future<Output = Result<(), ReactiveError>> + Send + 'async_trait>>where
Q: 'async_trait + Query,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn register_query<'life0, 'life1, 'async_trait, Q>(
&'life0 self,
signal: &'life1 Signal<Q::Result>,
query: Q,
) -> Pin<Box<dyn Future<Output = Result<(), ReactiveError>> + Send + 'async_trait>>where
Q: 'async_trait + Query,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Register a signal bound to a query. Read more
Source§fn query_dependencies(&self, signal_id: &SignalId) -> Option<Vec<FactPredicate>>
fn query_dependencies(&self, signal_id: &SignalId) -> Option<Vec<FactPredicate>>
Get the fact predicates that a signal depends on. Read more
Source§fn invalidate_queries<'life0, 'life1, 'async_trait>(
&'life0 self,
changed: &'life1 FactPredicate,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn invalidate_queries<'life0, 'life1, 'async_trait>(
&'life0 self,
changed: &'life1 FactPredicate,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Notify that facts matching a predicate have changed. Read more
Auto Trait Implementations§
impl Freeze for ReactiveHandler
impl !RefUnwindSafe for ReactiveHandler
impl Send for ReactiveHandler
impl Sync for ReactiveHandler
impl Unpin for ReactiveHandler
impl UnsafeUnpin for ReactiveHandler
impl !UnwindSafe for ReactiveHandler
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