pub struct CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>where
Change: Send + Sync + 'static,
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
WatchFn: Fn() -> Result<Box<dyn Stream<Item = Change> + Send + Unpin>, FloxideError> + Send + Sync + 'static,
ReactFn: Fn(Change, &mut Context) -> Result<Action, FloxideError> + Send + Sync + 'static,{ /* private fields */ }Expand description
A custom reactive node that uses a provided closure to create the watch stream and react to changes.
Implementations§
Source§impl<Change, Context, Action, WatchFn, ReactFn> CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>where
Change: Send + Sync + 'static,
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
WatchFn: Fn() -> Result<Box<dyn Stream<Item = Change> + Send + Unpin>, FloxideError> + Send + Sync + 'static,
ReactFn: Fn(Change, &mut Context) -> Result<Action, FloxideError> + Send + Sync + 'static,
impl<Change, Context, Action, WatchFn, ReactFn> CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>where
Change: Send + Sync + 'static,
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
WatchFn: Fn() -> Result<Box<dyn Stream<Item = Change> + Send + Unpin>, FloxideError> + Send + Sync + 'static,
ReactFn: Fn(Change, &mut Context) -> Result<Action, FloxideError> + Send + Sync + 'static,
Trait Implementations§
Source§impl<Change, Context, Action, WatchFn, ReactFn> ReactiveNode<Change, Context, Action> for CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>where
Change: Send + Sync + 'static,
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
WatchFn: Fn() -> Result<Box<dyn Stream<Item = Change> + Send + Unpin>, FloxideError> + Send + Sync + 'static,
ReactFn: Fn(Change, &mut Context) -> Result<Action, FloxideError> + Send + Sync + 'static,
impl<Change, Context, Action, WatchFn, ReactFn> ReactiveNode<Change, Context, Action> for CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>where
Change: Send + Sync + 'static,
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
WatchFn: Fn() -> Result<Box<dyn Stream<Item = Change> + Send + Unpin>, FloxideError> + Send + Sync + 'static,
ReactFn: Fn(Change, &mut Context) -> Result<Action, FloxideError> + Send + Sync + 'static,
Source§fn watch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Change> + Send + Unpin>, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn watch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Change> + Send + Unpin>, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set up a stream of changes to watch
Source§fn react_to_change<'life0, 'life1, 'async_trait>(
&'life0 self,
change: Change,
ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<Action, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn react_to_change<'life0, 'life1, 'async_trait>(
&'life0 self,
change: Change,
ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<Action, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
React to a detected change
Auto Trait Implementations§
impl<Change, Context, Action, WatchFn, ReactFn> Freeze for CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>
impl<Change, Context, Action, WatchFn, ReactFn> RefUnwindSafe for CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>where
Change: RefUnwindSafe,
Context: RefUnwindSafe,
Action: RefUnwindSafe,
WatchFn: RefUnwindSafe,
ReactFn: RefUnwindSafe,
impl<Change, Context, Action, WatchFn, ReactFn> Send for CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>
impl<Change, Context, Action, WatchFn, ReactFn> Sync for CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>
impl<Change, Context, Action, WatchFn, ReactFn> Unpin for CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>
impl<Change, Context, Action, WatchFn, ReactFn> UnsafeUnpin for CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>
impl<Change, Context, Action, WatchFn, ReactFn> UnwindSafe for CustomReactiveNode<Change, Context, Action, WatchFn, ReactFn>where
WatchFn: RefUnwindSafe,
ReactFn: RefUnwindSafe,
Change: UnwindSafe,
Context: UnwindSafe,
Action: UnwindSafe,
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