pub struct Cmd<MSG> { /* private fields */ }
Expand description
Cmd is a way to tell the Runtime that something needs to be executed
Implementations§
source§impl<MSG> Cmd<MSG>where
MSG: 'static,
impl<MSG> Cmd<MSG>where
MSG: 'static,
sourcepub fn once<F>(f: F) -> Cmd<MSG>where
F: Future<Output = MSG> + 'static,
pub fn once<F>(f: F) -> Cmd<MSG>where
F: Future<Output = MSG> + 'static,
Creates a Cmd which expects to be polled only once
sourcepub fn recurring(
rx: UnboundedReceiver<MSG>,
event_closure: Closure<dyn FnMut(Event)>
) -> Cmd<MSG>
pub fn recurring( rx: UnboundedReceiver<MSG>, event_closure: Closure<dyn FnMut(Event)> ) -> Cmd<MSG>
Creates a Cmd which will be polled multiple times
sourcepub fn map_msg<F, MSG2>(self, f: F) -> Cmd<MSG2>
pub fn map_msg<F, MSG2>(self, f: F) -> Cmd<MSG2>
map the msg of this Cmd such that Cmd
sourcepub fn batch(tasks: impl IntoIterator<Item = Cmd<MSG>>) -> Cmd<MSG>
pub fn batch(tasks: impl IntoIterator<Item = Cmd<MSG>>) -> Cmd<MSG>
batch together multiple Cmd into one task
Trait Implementations§
source§impl<APP> From<Cmd<<APP as Application>::MSG>> for Dispatch<APP>where
APP: Application,
impl<APP> From<Cmd<<APP as Application>::MSG>> for Dispatch<APP>where
APP: Application,
Auto Trait Implementations§
impl<MSG> Freeze for Cmd<MSG>
impl<MSG> !RefUnwindSafe for Cmd<MSG>
impl<MSG> !Send for Cmd<MSG>
impl<MSG> !Sync for Cmd<MSG>
impl<MSG> Unpin for Cmd<MSG>
impl<MSG> !UnwindSafe for Cmd<MSG>
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