Struct reactive_state::StoreRef [−][src]
pub struct StoreRef<State, Action, Event, Effect>(_);
Expand description
Implementations
impl<State, Action, Event, Effect> StoreRef<State, Action, Event, Effect> where
Event: Clone + Hash + Eq,
[src]
impl<State, Action, Event, Effect> StoreRef<State, Action, Event, Effect> where
Event: Clone + Hash + Eq,
[src]Methods from Deref<Target = Store<State, Action, Event, Effect>>
pub fn state(&self) -> Rc<State>
[src]
pub fn state(&self) -> Rc<State>
[src]Get the current State
stored in this store.
Modifications to this state need to be performed by
dispatching an Action
to the store using
dispatch().
pub fn dispatch<A: Into<Action>>(&self, action: A)
[src]
pub fn dispatch<A: Into<Action>>(&self, action: A)
[src]Dispatch an Action
to be passed to the Reducer in order to
modify the State
in this store, and produce Events
to be
sent to the store listeners.
pub fn subscribe<L: AsListener<State, Event>>(&self, listener: L)
[src]
pub fn subscribe<L: AsListener<State, Event>>(&self, listener: L)
[src]Subscribe a Listener to changes in the store state and
events produced by the Reducer as a result of Action
s
dispatched via dispatch().
The listener is a weak reference; when the strong reference associated with it (usually Callback) is dropped, the listener will be removed from this store upon dispatch().
If you want to subscribe to state changes associated with
specific Event
s, see
subscribe_event() or
subscribe_event()
pub fn subscribe_event<L: AsListener<State, Event>>(
&self,
listener: L,
event: Event
)
[src]
pub fn subscribe_event<L: AsListener<State, Event>>(
&self,
listener: L,
event: Event
)
[src]Subscribe a Listener to changes in the store state and
events produced by the Reducer as a result of Action
s
being dispatched via dispatch() and
reduced with the store’s Reducer. This subscription is only
active changes which produce the specific matching event
from the Reducer.
The listener is a weak reference; when the strong reference associated with it (usually Callback) is dropped, the listener will be removed from this store upon dispatch().
pub fn subscribe_events<L: AsListener<State, Event>, E: IntoIterator<Item = Event>>(
&self,
listener: L,
events: E
)
[src]
pub fn subscribe_events<L: AsListener<State, Event>, E: IntoIterator<Item = Event>>(
&self,
listener: L,
events: E
)
[src]Subscribe a Listener to changes in the store state and
events produced by the Reducer as a result of Action
s
being dispatched via dispatch() and
reduced with the store’s Reducer. This subscription is only
active changes which produce any of the specific matching
events
from the Reducer.
The listener is a weak reference; when the strong reference associated with it (usually Callback) is dropped, the listener will be removed from this store upon dispatch().
pub fn add_middleware<M: Middleware<State, Action, Event, Effect> + 'static>(
&self,
middleware: M
)
[src]
pub fn add_middleware<M: Middleware<State, Action, Event, Effect> + 'static>(
&self,
middleware: M
)
[src]Add Middleware to modify the behaviour of this Store during a dispatch().
Trait Implementations
Auto Trait Implementations
impl<State, Action, Event, Effect> !RefUnwindSafe for StoreRef<State, Action, Event, Effect>
impl<State, Action, Event, Effect> !Send for StoreRef<State, Action, Event, Effect>
impl<State, Action, Event, Effect> !Sync for StoreRef<State, Action, Event, Effect>
impl<State, Action, Event, Effect> Unpin for StoreRef<State, Action, Event, Effect>
impl<State, Action, Event, Effect> !UnwindSafe for StoreRef<State, Action, Event, Effect>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T, V> IntoOptPropValue<V> for T where
T: IntoPropValue<Option<V>>,
[src]
impl<T, V> IntoOptPropValue<V> for T where
T: IntoPropValue<Option<V>>,
[src]pub fn into_opt_prop_value(self) -> Option<V>
[src]
pub fn into_opt_prop_value(self) -> Option<V>
[src]Convert self
to an optional value of a Properties
struct.
impl<T> IntoPropValue<Option<T>> for T
[src]
impl<T> IntoPropValue<Option<T>> for T
[src]pub fn into_prop_value(self) -> Option<T>
[src]
pub fn into_prop_value(self) -> Option<T>
[src]Convert self
to a value of a Properties
struct.
impl<T> IntoPropValue<T> for T
[src]
impl<T> IntoPropValue<T> for T
[src]pub fn into_prop_value(self) -> T
[src]
pub fn into_prop_value(self) -> T
[src]Convert self
to a value of a Properties
struct.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> Any for T where
T: Any,
T: Any,
impl<T> CloneAny for T where
T: Any + Clone,
T: Any + Clone,