pub struct TeaStore<S, M> { /* private fields */ }Expand description
Writable store — dispatch actions; model snapshots arrive on subscription channels.
Implementations§
Source§impl<S, M> TeaStore<S, M>
impl<S, M> TeaStore<S, M>
pub fn send(&self, action: M) -> StoreTask
pub fn dispatch(&self, action: M)
Sourcepub fn try_state(&self) -> Result<S, TeaStoreError>
pub fn try_state(&self) -> Result<S, TeaStoreError>
Request a point-in-time model snapshot from the reducer thread (blocks until reply).
Sourcepub fn state(&self) -> Result<S, TeaStoreError>
pub fn state(&self) -> Result<S, TeaStoreError>
Same as Self::try_state — provided for call sites that expect infallible reads.
Sourcepub fn view_store(&self) -> TeaViewStore<S, M>
pub fn view_store(&self) -> TeaViewStore<S, M>
Read-only view handle — clone onto reader threads.
pub fn cancel(&self, id: EffectId)
pub fn try_subscribe_state(
&self,
) -> Result<TeaStateSubscriber<S>, TeaStoreError>where
S: PartialEq,
Sourcepub fn subscribe_state(&self) -> Result<TeaStateSubscriber<S>, TeaStoreError>where
S: PartialEq,
pub fn subscribe_state(&self) -> Result<TeaStateSubscriber<S>, TeaStoreError>where
S: PartialEq,
Subscribe to model snapshots pushed after each reduce (no shared-state lock).
pub fn try_subscribe_changes( &self, ) -> Result<TeaChangeSubscriber<S>, TeaStoreError>
Sourcepub fn subscribe_changes(&self) -> Result<TeaChangeSubscriber<S>, TeaStoreError>
pub fn subscribe_changes(&self) -> Result<TeaChangeSubscriber<S>, TeaStoreError>
Field-level changes derived from pushed snapshots (no lock on live state).
pub fn scope<CS, CM, AK, SK>( &self, state_kp: SK, action_kp: AK, ) -> ScopedTeaStore<S, M, CS, CM, AK, SK>
Trait Implementations§
Auto Trait Implementations§
impl<S, M> !RefUnwindSafe for TeaStore<S, M>
impl<S, M> !UnwindSafe for TeaStore<S, M>
impl<S, M> Freeze for TeaStore<S, M>
impl<S, M> Send for TeaStore<S, M>
impl<S, M> Sync for TeaStore<S, M>
impl<S, M> Unpin for TeaStore<S, M>
impl<S, M> UnsafeUnpin for TeaStore<S, M>
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