pub struct ReactiveNodeAdapter<R, Change, Context, Action>where
Change: Send + Sync + 'static,
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
R: ReactiveNode<Change, Context, Action> + Send + 'static,{ /* private fields */ }Expand description
An adapter that allows a ReactiveNode to be used as a standard Node. This adapter handles the streaming and change detection.
Implementations§
Source§impl<R, Change, Context, Action> ReactiveNodeAdapter<R, Change, Context, Action>where
Change: Send + Sync + 'static,
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
R: ReactiveNode<Change, Context, Action> + Send + 'static,
impl<R, Change, Context, Action> ReactiveNodeAdapter<R, Change, Context, Action>where
Change: Send + Sync + 'static,
Context: Send + Sync + 'static,
Action: ActionType + Send + Sync + 'static + Debug,
R: ReactiveNode<Change, Context, Action> + Send + 'static,
Sourcepub fn with_buffer_size(self, size: usize) -> Self
pub fn with_buffer_size(self, size: usize) -> Self
Set the buffer size for the change stream
Sourcepub async fn start_watching(
&self,
ctx: Context,
) -> Result<impl Stream<Item = Action> + Unpin, FloxideError>
pub async fn start_watching( &self, ctx: Context, ) -> Result<impl Stream<Item = Action> + Unpin, FloxideError>
Start watching for changes and process them in the background
Trait Implementations§
Source§impl<R, Change, Context, Action> Node<Context, Action> for ReactiveNodeAdapter<R, Change, Context, Action>
impl<R, Change, Context, Action> Node<Context, Action> for ReactiveNodeAdapter<R, Change, Context, Action>
Source§fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<NodeOutcome<Self::Output, Action>, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<NodeOutcome<Self::Output, Action>, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process the node asynchronously
Auto Trait Implementations§
impl<R, Change, Context, Action> Freeze for ReactiveNodeAdapter<R, Change, Context, Action>
impl<R, Change, Context, Action> RefUnwindSafe for ReactiveNodeAdapter<R, Change, Context, Action>
impl<R, Change, Context, Action> Send for ReactiveNodeAdapter<R, Change, Context, Action>
impl<R, Change, Context, Action> Sync for ReactiveNodeAdapter<R, Change, Context, Action>
impl<R, Change, Context, Action> Unpin for ReactiveNodeAdapter<R, Change, Context, Action>
impl<R, Change, Context, Action> UnsafeUnpin for ReactiveNodeAdapter<R, Change, Context, Action>
impl<R, Change, Context, Action> UnwindSafe for ReactiveNodeAdapter<R, Change, Context, Action>
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