pub struct StateContainer<St>(/* private fields */);
Implementations§
Source§impl<St> StateContainer<St>
impl<St> StateContainer<St>
pub fn subscribe_event<T: Clone + 'static>(
&self,
channel: impl Fn(&mut St) -> &mut EventChannel<T> + 'static,
) -> impl Stream<Item = T> + 'staticwhere
St: 'static,
pub fn subscribe_event_with<T, U, I>(
&self,
channel: impl Fn(&mut St) -> &mut EventChannel<T> + 'static,
inits: impl FnOnce(&mut St, &mut StateContext) -> I + 'static,
filter_map: impl FnMut(&T) -> Option<U> + 'static,
) -> impl Stream<Item = U> + 'staticwhere
St: 'static,
T: 'static,
U: 'static,
I: IntoIterator<Item = U>,
Source§impl<St> StateContainer<St>
impl<St> StateContainer<St>
pub fn new(f: impl FnOnce(&mut StateContext) -> St) -> Self
pub async fn poll_fn<U>( &self, f: impl FnMut(&mut St, &mut StateContext) -> Poll<U>, ) -> U
pub fn poll_fn_stream<U>(
&self,
f: impl FnMut(&mut St, &mut StateContext) -> Poll<Option<U>> + 'static,
) -> impl Stream<Item = U> + 'staticwhere
St: 'static,
pub fn subscribe<U>( &self, f: impl FnMut(&mut St, &mut StateContext) -> U + 'static, ) -> impl Stream<Item = U> + 'static
pub fn update<T>(&self, f: impl FnOnce(&mut St, &mut StateContext) -> T) -> T
Trait Implementations§
Auto Trait Implementations§
impl<St> Freeze for StateContainer<St>
impl<St> RefUnwindSafe for StateContainer<St>
impl<St> Send for StateContainer<St>where
St: Send,
impl<St> Sync for StateContainer<St>where
St: Send,
impl<St> Unpin for StateContainer<St>
impl<St> UnwindSafe for StateContainer<St>
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