Struct redux_rs::StoreWithMiddleware
source · [−]pub struct StoreWithMiddleware<Inner, M, State, InnerAction, OuterAction> where
Inner: StoreApi<State, InnerAction> + Send + Sync,
M: MiddleWare<State, OuterAction, InnerAction> + Send + Sync,
State: Send + Sync + 'static,
InnerAction: Send + Sync + 'static,
OuterAction: Send + Sync + 'static, { /* private fields */ }
Expand description
Store which ties an underlying store and middleware together.
Implementations
sourceimpl<Inner, M, State, InnerAction, OuterAction> StoreWithMiddleware<Inner, M, State, InnerAction, OuterAction> where
Inner: StoreApi<State, InnerAction> + Send + Sync,
M: MiddleWare<State, OuterAction, InnerAction> + Send + Sync,
State: Send + Sync + 'static,
InnerAction: Send + Sync + 'static,
OuterAction: Send + Sync + 'static,
impl<Inner, M, State, InnerAction, OuterAction> StoreWithMiddleware<Inner, M, State, InnerAction, OuterAction> where
Inner: StoreApi<State, InnerAction> + Send + Sync,
M: MiddleWare<State, OuterAction, InnerAction> + Send + Sync,
State: Send + Sync + 'static,
InnerAction: Send + Sync + 'static,
OuterAction: Send + Sync + 'static,
sourcepub async fn wrap<MNew, NewOuterAction>(
self,
middleware: MNew
) -> StoreWithMiddleware<Self, MNew, State, OuterAction, NewOuterAction> where
MNew: MiddleWare<State, NewOuterAction, OuterAction> + Send + Sync,
NewOuterAction: Send + Sync + 'static,
State: Sync,
pub async fn wrap<MNew, NewOuterAction>(
self,
middleware: MNew
) -> StoreWithMiddleware<Self, MNew, State, OuterAction, NewOuterAction> where
MNew: MiddleWare<State, NewOuterAction, OuterAction> + Send + Sync,
NewOuterAction: Send + Sync + 'static,
State: Sync,
Wrap the store with middleware
Trait Implementations
sourceimpl<Inner, M, State, InnerAction, OuterAction> StoreApi<State, OuterAction> for StoreWithMiddleware<Inner, M, State, InnerAction, OuterAction> where
Inner: StoreApi<State, InnerAction> + Send + Sync,
M: MiddleWare<State, OuterAction, InnerAction> + Send + Sync,
State: Send + Sync + 'static,
InnerAction: Send + Sync + 'static,
OuterAction: Send + Sync + 'static,
impl<Inner, M, State, InnerAction, OuterAction> StoreApi<State, OuterAction> for StoreWithMiddleware<Inner, M, State, InnerAction, OuterAction> where
Inner: StoreApi<State, InnerAction> + Send + Sync,
M: MiddleWare<State, OuterAction, InnerAction> + Send + Sync,
State: Send + Sync + 'static,
InnerAction: Send + Sync + 'static,
OuterAction: Send + Sync + 'static,
sourcefn dispatch<'life0, 'async_trait>(
&'life0 self,
action: OuterAction
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn dispatch<'life0, 'async_trait>(
&'life0 self,
action: OuterAction
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Dispatch a new action to the store Read more
sourcefn select<'life0, 'async_trait, S: Selector<State, Result = Result>, Result>(
&'life0 self,
selector: S
) -> Pin<Box<dyn Future<Output = Result> + Send + 'async_trait>> where
S: Selector<State, Result = Result> + Send + 'static,
Result: Send + 'static,
S: 'async_trait,
Result: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn select<'life0, 'async_trait, S: Selector<State, Result = Result>, Result>(
&'life0 self,
selector: S
) -> Pin<Box<dyn Future<Output = Result> + Send + 'async_trait>> where
S: Selector<State, Result = Result> + Send + 'static,
Result: Send + 'static,
S: 'async_trait,
Result: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Select a part of the state, this is more efficient than copying the entire state all the time. In case you still need a full copy of the state, use the state_cloned method. Read more
sourcefn subscribe<'life0, 'async_trait, S: Subscriber<State> + Send + 'static>(
&'life0 self,
subscriber: S
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
S: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn subscribe<'life0, 'async_trait, S: Subscriber<State> + Send + 'static>(
&'life0 self,
subscriber: S
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
S: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Subscribe to state changes. Every time an action is dispatched the subscriber will be notified after the state is updated Read more
sourcefn state_cloned<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = State> + Send + 'async_trait>> where
State: Clone,
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn state_cloned<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = State> + Send + 'async_trait>> where
State: Clone,
'life0: 'async_trait,
Self: Sync + 'async_trait,
Returns a cloned version of the state. This is not efficient, if you only need a part of the state use select instead Read more
Auto Trait Implementations
impl<Inner, M, State, InnerAction, OuterAction> RefUnwindSafe for StoreWithMiddleware<Inner, M, State, InnerAction, OuterAction> where
Inner: RefUnwindSafe,
InnerAction: RefUnwindSafe,
M: RefUnwindSafe,
OuterAction: RefUnwindSafe,
State: RefUnwindSafe,
impl<Inner, M, State, InnerAction, OuterAction> Send for StoreWithMiddleware<Inner, M, State, InnerAction, OuterAction>
impl<Inner, M, State, InnerAction, OuterAction> Sync for StoreWithMiddleware<Inner, M, State, InnerAction, OuterAction>
impl<Inner, M, State, InnerAction, OuterAction> Unpin for StoreWithMiddleware<Inner, M, State, InnerAction, OuterAction> where
InnerAction: Unpin,
M: Unpin,
OuterAction: Unpin,
State: Unpin,
impl<Inner, M, State, InnerAction, OuterAction> UnwindSafe for StoreWithMiddleware<Inner, M, State, InnerAction, OuterAction> where
Inner: RefUnwindSafe,
InnerAction: UnwindSafe,
M: UnwindSafe,
OuterAction: UnwindSafe,
State: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more